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

Add test for clhsdb "symbol" command

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • None
    • b14

      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.

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

              Created:
              Updated:
              Resolved: