RFR: 8247514: Improve clhsdb 'findpc' ability to determine what an address points to by improving PointerFinder and PointerLocation classes [v2]
Kevin Walls
kevinw at openjdk.java.net
Thu Feb 11 09:00:44 UTC 2021
On Wed, 10 Feb 2021 21:12:19 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java line 247:
>>
>>> 245: stackThread.getStackBase(), stackThread.lastSPDbg(),
>>> 246: stackThread.getStackBase().addOffsetTo(-stackThread.getStackSize()),
>>> 247: stackThread);
>>
>> When we print a JavaThread, in the verbose block,
>> the final argument to tty.format in line 247, I wonder what that prints?
>>
>> We then call printThreadInfoOn() which will first print the quoted thread name,
>> so maybe we don't need that item.
>> Or maybe we want the JavaThread.toString()?
>
> `stackThread.toString()` ends up in `VMObject.toString()`:
>
> public String toString() {
> return getClass().getName() + "@" + addr;
> }
> And here's an example output:
> hsdb> + findpc 0x0000152f45df6000
> Address 0x0000152f45df6000: In java stack [0x0000152f45df8000,0x0000152f45df6580,0x0000152f45cf7000] for thread sun.jvm.hotspot.runtime.JavaThread at 0x0000152f3c026f70:
> "main" #1 prio=5 tid=0x0000152f3c026f70 nid=0x308e waiting on condition [0x0000152f45df6000]
> java.lang.Thread.State: TIMED_WAITING (sleeping)
> JavaThread state: _thread_blocked
> So I think the `stackThread` argument is doing what was intended, and there is no duplication in the output.
Great, thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2111
More information about the hotspot-gc-dev
mailing list