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

Keith McGuigan keith.mcguigan at
Fri Feb 25 07:13:41 PST 2011

I think that looks better, thanks for making those changes.  Two minor  

(1) os.hpp:496 - you don't need the "os::" prefix here.

(2) (and this isn't a big deal) Why go through the work in the  
arguments code to determine the launcher and store that result rather  
than just looking at the _sun_java_launcher value at the time that you  
need it (in check_and_debugger_and_wait())?

- Keith

On Feb 25, 2011, at 9:56 AM, Staffan Larsen wrote:

> And I should have included the latest webrev link:
> /Staffan
>> -----Original Message-----
>> From: Staffan Larsen
>> Sent: den 25 februari 2011 15:47
>> To: Dmitriy Samersoff
>> Cc: Dmitriy Samersoff; hotspot-runtime-dev at
>> Subject: RE: Request for review (S): 7022037: Pause when exiting if a
>> debugger is attached on windows
>>> 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?
>> /Staffan

More information about the hotspot-runtime-dev mailing list