• b04



        "mem" is very similar to "examine". There are 3 differences:
        (1) "mem" prints just one word of memory per line whereas "examine" prints as many as will fit. This difference will remain since it is intentional.
        (2) if the address is in a .dso, instead of printing the address, "mem" will print the native symbol name plus the offset. However, this doesn't actually appear to work, so I plan on dropping this feature. However, see the -v option below.
        (3) The address range argument for "mem" is the start address plus an optional argument which is number of words to print: "mem address [ length ]". The syntax for "examine" is "examine { address[/count] | address,address }". I plan on having "mem" support the same address range argument as "examine". That means specifying the count as a separate argument won't be supported. The count instead needs to be part of the "address[/count]" argument.

        I also plan on adding a -v option to "mem". It will serve two purposes. The first is to essentially do a findpc on the address to print out what the address points to. This will help make up for no longer printing native symbol names for each line of output. Instead if the address is a native symbol (or any other type of memory that SA recognizes) you will see that in the findpc output. The 2nd thing -v will trigger is for each value in memory that is printed, it will also call findpc on that value, so if it is an address it will print out what the address is for. Here's an example showing the contents of the 1st 20 words of a hotspot Method object.

        hsdb> mem -v 0x0000151c4c403530/20
        Address 0x0000151c4c403530: Method jdk/test/lib/apps/LingeredApp.steadyState(Ljava/lang/Object;)V@0x0000151c4c403530
        0x0000151c4c403530: 0x0000151c919cebc8 vtable for Method + 0x10
        0x0000151c4c403538: 0x0000000000000000
        0x0000151c4c403540: 0x0000151c4c4034d0
        0x0000151c4c403548: 0x0000151c4c406c00 MethodData for steadyState(Ljava/lang/Object;)V
        0x0000151c4c403550: 0x0000151c4c406bc0 Is of type MethodCounters
        0x0000151c4c403558: 0x0000151c882b1810
        0x0000151c4c403560: 0xfffffffeb000000a
        0x0000151c4c403568: 0x0000000000000000
        0x0000151c4c403570: 0x0000000000000000
        0x0000151c4c403578: 0x0000151c70851c00 In interpreter codelet: method entry point (kind = zerolocals) [0x0000151c70851be8, 0x0000151c708521e0) 1528 bytes
        0x0000151c4c403580: 0x0000151c785733a0 In code in NMethod for jdk/test/lib/apps/LingeredApp.steadyState(Ljava/lang/Object;)V==>nsun.jvm.hotspot.code.NMethod@0x0000151c78573210
        0x0000151c4c403588: 0x0000151c78573210 Is of type nmethod
        0x0000151c4c403590: 0x0000151c70958d60 In code in sun.jvm.hotspot.code.AdapterBlob@0x0000151c70958c90
        0x0000151c4c403598: 0x00ff020000000015
        0x0000151c4c4035a0: 0x000702000702000d
        0x0000151c4c4035a8: 0x00fa810107010002
        0x0000151c4c4035b0: 0x0000000000000004
        0x0000151c4c4035b8: 0x000000000000019d
        0x0000151c4c4035c0: 0x0000151c4c400260 ConstantPool for jdk/test/lib/apps/LingeredApp
        0x0000151c4c4035c8: 0x0000151c4c403690


          Issue Links



                cjplummer Chris Plummer
                cjplummer Chris Plummer
                0 Vote for this issue
                4 Start watching this issue