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

Dmitry Samersoff Dmitry.Samersoff at oracle.com
Fri Feb 25 04:47:18 PST 2011


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.

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.

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)

-Dmitry



On 2011-02-25 12:12, Staffan Larsen wrote:
> Updated webrev: http://cr.openjdk.java.net/~sla/7022037/webrev.03/
>
> Thanks,
> /Staffan
>
>
>
>> -----Original Message-----
>> From: Dmitry Samersoff
>> Sent: den 24 februari 2011 16:41
>> 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,
>>
>> On 2011-02-24 18:25, Staffan Larsen wrote:
>>> How about, as others suggested, we enable it only when the
>> hotspot.exe
>>> launcher! is used? This is the use-case I am interested in, and I
>> don't
>>> think any tests would be using it.
>>
>> Sounds OK for me.
>>
>> -Dmitry
>>
>>
>>
>>
>>>
>>> Thanks,
>>>
>>> /Staffan
>>>
>>> *From:*Daniel D. Daugherty
>>> *Sent:* den 24 februari 2011 4:11
>>> *To:* hotspot-runtime-dev at openjdk.java.net
>>> *Subject:* Re: Request for review (S): 7022037: Pause when exiting
>> if a
>>> debugger is attached on windows
>>>
>>> Trying again since I got a bounce from the Oracle mailer...
>>>
>>> On 2/24/2011 7:49 AM, Staffan Larsen wrote:
>>>
>>>      Does the method IsDebuggerPresent() distinguish between Visual
>>>
>>>      Studio,
>>>
>>>      windbg, cdbg, adplus and so one?
>>>
>>>
>>>
>>>
>>>
>>> No, I think it works for all of them.
>> See:http://msdn.microsoft.com/en-us/library/ms680345(VS.85).aspx
>>>
>>>
>>>
>>>
>>>
>>>      Can we automatically turn this future off when debugging remote
>> JVM
>>>
>>>      or windows service?
>>>
>>>
>>>
>>>
>>>
>>> I'm not sure how to do that, but I added an option to turn it off
>> manually: -XX:-PauseAtExit
>>>
>>>
>>>
>>>
>>> So for tests where we are intentionally causing a crash in order
>>> to attach to the crash dump, we will need to add this new option.
>>> I'm thinking about SA tests here.
>>>
>>> More likely we will need:
>>>
>>> -XX:+IgnoreUnrecognizedVMOptions -XX:-PauseAtExit
>>>
>>> in order for the tests to work with VMs that don't have the option.
>>>
>>> Dan
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>      Can we detect JVM launched by custom launcher (not a java.exe)
>> and
>>>
>>>      turn this future off in this case (custom launcher could have
>> no console)?
>>>
>>>
>>>
>>>
>>>
>>> Don't know how to do that automatically. I'm actually mostly
>> interested in having it turned on for the hotspot.exe launcher.
>>>
>>>
>>>
>>> /Staffan
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Dmitry Samersoff
>> Java Hotspot development team, SPB04
>> * There will come soft rains ...


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


More information about the hotspot-runtime-dev mailing list