RFR: 8029630: Print thread id hex representation in error messages.
thomas.stuefe at gmail.com
Thu Apr 9 19:44:12 UTC 2015
looks ok and will certainly do what you want.
I guess whether you use PTR_FORMAT, INTPTR_FORMAT or SIZE_FORMAT_HEX is
mostly a matter of taste. The former two will give you full-width numbers
(e.g. 0x00000000000000A1), the last one would give you just 0xA1.
Kind Regards, Thomas
On Thu, Apr 9, 2015 at 9:11 PM, Max Ockner <max.ockner at oracle.com> wrote:
> Hi again,
> After working past some build issues, I have a new webrev. I've changed
> %x to PTR_FORMAT, and I've removed the modification to thread.cpp
> New webrev: http://cr.openjdk.java.net/~mockner/8029630.4/
> On 4/6/2015 9:10 PM, David Holmes wrote:
>> Hi Max,
>> On 3/04/2015 5:38 AM, Max Ockner wrote:
>>> Please review this change:
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8029630
>>> Webrev: http://cr.openjdk.java.net/~mockner/8029630.2/
>>> Summary: Existing error messages for vm crashes print the decimal
>>> representation of the current thread id. The message format has been
>>> changed to print the hex value of the thread id.
>> The change is incorrect and unnecessary. 'this' is a pointer type so
>> INTPTR_FORMAT seems correct (though it may need p2i(this)?) while %x
>> assumes 'this' is always 32-bit. Further INTPTR_FORMAT is already hex not
>> As Thomas pointed out%x assumes 32-bit and so is incorrect for intx type.
>> As intx is a typedef for intptr_t then INTPTR_FORMAT should be usable here
>> as well.
>> Tested with jtreg runtime to make sure nothing was broken. I tested the
>>> new functionality separately. I crashed the vm and examined the debugger
>>> output to make sure the hexadecimal thread id printed in the error
>>> message matched one of the threads listed by the debugger.
More information about the hotspot-dev