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

Keith McGuigan keith.mcguigan at oracle.com
Fri Feb 25 05:03:29 PST 2011


Hi Staffan --

Can you refactor the code in java.cpp so that we don't have the #ifdef  
WINDOWS there?  Maybe add a method for wait_for_key_press() in the  
os.hpp interface and implement it separately for windows and posix.

Actually if you add a more generic method into os, like  
'check_for_debugger_and_wait()', then you can just call this  
unconditionally (which will simplify the common code) and perform your  
launcher/flag/debugger check in the body of that method (and just for  
windows - posix would simply return).  Might not even need  
'is_debugger_attached' anymore since you could put all the code into  
os_windows.cpp.

--
- Keith

On Feb 25, 2011, at 4:12 AM, 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 ...



More information about the hotspot-runtime-dev mailing list