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

Dmitry Samersoff Dmitry.Samersoff at
Fri Feb 25 06:27:57 PST 2011


On 2011-02-25 16:46, Staffan Larsen wrote:
>> 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()?

See comment from Keith, I agree with him.

>> 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.

If my memory is not bogus GetConsoleMode returns error if console is not 
attached but it's better to check it.

Dmitry Samersoff
Java Hotspot development team, SPB04
* There will come soft rains ...

More information about the hotspot-runtime-dev mailing list