Request for review (S): 7022037: Pause when exiting if a debugger is attached on windows

Staffan Larsen staffan.larsen at oracle.com
Fri Feb 25 05:46:59 PST 2011


See below.

> -----Original Message-----
> From: Dmitry Samersoff
> Sent: den 25 februari 2011 13:47
> To: Staffan Larsen
> Cc: hotspot-runtime-dev at openjdk.java.net
> Subject: Re: Request for review (S): 7022037: Pause when exiting if a
> debugger is attached on windows
> 
> Staffan,
> 
> 1. I think it's better to create the diagnostic flag PauseAtExit with
> default false and then change this value to true if we run gamma
> rather
> than check for gamma launcher every time.

I can do that. Where would be a good place to do this check? Inside Arguments::process_sun_java_launcher_properties()?

> 2. I think wait_for_key_press() should be inserted into the all
> places
> where vm exists (i.e. where notify_vm_shutdown called) rather than to
> notify_vm_shutdown. This function (notify_vm_shutdown) has it's own
> concrete semantic and I would prefer to keep it.

I can fix that.
 
> 3. May be it's better to use ReadConsoleInput and WaitForSingleObject
> to
> address the case where stdin is overloaded/intercepted by ide. Also
> console function could determine whether console attached or not
> (i.e.
> don't try to read from within service)

How do you determine if a console is attached? AttachConsole and check that error isn't ERROR_INVALID_HANDLE? I haven't used the Windows console API before.

/Staffan



More information about the hotspot-runtime-dev mailing list