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

Staffan Larsen staffan.larsen at
Fri Feb 25 06:47:11 PST 2011

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

I didn't see anything about this in Keith's reply.

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

Since I will only wait for key press if the gamma launcher is used, and the gamma launcher is a console application, I don't think further checks are necessary. Do you agree?


More information about the hotspot-runtime-dev mailing list