JDK-8247514 : Improve clhsdb 'findpc' ability to determine what an address points to by improving PointerFinder and PointerLocation classes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-06-12
  • Updated: 2021-02-18
  • Resolved: 2021-02-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17 b10Fixed
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
There's a task JDK-8244670 to convert the clhsdb whatis command from javascript to java since javascript support no longer works. I looked at whatis does, and it uses PointerFinder/PointerLocation just like findpc, but then uses LoadObject.lookup() if PointerFinder fails. This tries to lookup the address as a symbol in one of the dlls. I decided it would be best to just add this functionality to PointerFinder and PointerLocatoin, and found there were a few other address types that PointerFinder should check for that would make findpc even better. Here's the full list:

1. C++ symbol. Use LoadObject.lookup() to determine the C++ symbol that the address is closest too.
2. MetaData objects. Wrap a MetaData object around the address, allowing PointerLocation to later call MetdaData.printValueOn(). This will display details about objects like instances of Method and InstanceKlass
3. Object type. If the object is not a MetaData instance, simply print the name of the objects type.
4. Java stack address. If the address is in a JavaThread's java stack, display information about the JavaThread and the stack boundaries.

There are also some minor adjustments being made to various printOn() and similar methods so they do a better job of printing when called by PointerLocation.

Note that when the mem command is also converted to java, these changes will help there also as mem calls PointerFinder for each address displayed. See JDK-8244669.
Comments
Changeset: e29c560a Author: Chris Plummer <cjplummer@openjdk.org> Date: 2021-02-12 22:01:43 +0000 URL: https://git.openjdk.java.net/jdk/commit/e29c560a
12-02-2021