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

Add test for clhsdb "symbol" command

    XMLWordPrintable

    Details

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

      Description

      The clhsdb "symbol" command is used to print the hotspot Symbol at a certain address. We should add a test for it. The following approach should work:

      Use "class java.lang.Thread" to get the address of the InstanceKlass for java.lang.Thread:

      hsdb> class java.lang.Thread
      java/lang/Thread @0x0000000800024398

      Use "inspect" of that address to dump all the fields of the java.lang.Thread InstanceKlass:

      hsdb> inspect 0x0000000800024398
      Type is InstanceKlass (size of 480)
      juint Klass::_super_check_offset: 64
      ...
      Symbol* Klass::_name: Symbol @ 0x0000000800471120
      AccessFlags Klass::_access_flags: 52428833
      markWord Klass::_prototype_header: 1
      ...

      One of the fields is a Symbol instance, and the address is given. Use "symbol" on that address:

      hsdb> symbol 0x0000000800471120
      #java/lang/Thread

      Confirm that that symbol is for the name of the class we used the "class" command on.

      An additional benefit of this test is that is also tests the "class" and "inspect" commands, which we currently don't have any testing for.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vsharma Vipin Sharma
              Reporter:
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: