Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8247514

Improve clhsdb 'findpc' ability to determine what an address points to by improving PointerFinder and PointerLocation classes

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b10

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cjplummer Chris Plummer
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: