sun.jvm.hotspot.debugger.Address Java Examples

The following examples show how to use sun.jvm.hotspot.debugger.Address. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    int tokens = t.countTokens();
    if (tokens != 1) {
        usage();
        return;
    }
    String name = t.nextToken();
    Address addr = null;
    try {
        addr = VM.getVM().getDebugger().parseAddress(name);
    } catch (NumberFormatException e) {
       out.println(e);
       return;
    }

    HTMLGenerator generator = new HTMLGenerator(false);
    out.println(generator.genHTML(addr));
}
 
Example #2
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 0) {
        usage();
    } else {
        final PrintStream fout = out;
        final HTMLGenerator gen = new HTMLGenerator(false);
        CodeCacheVisitor v = new CodeCacheVisitor() {
                public void prologue(Address start, Address end) {
                }
                public void visit(CodeBlob blob) {
                    fout.println(gen.genHTML(blob.contentBegin()));
                }
                public void epilogue() {
                }


            };
        VM.getVM().getCodeCache().iterate(v);
    }
}
 
Example #3
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
Address lookup(String symbol) {
    if (symbol.indexOf("::") != -1) {
        String[] parts = symbol.split("::");
        StringBuffer mangled = new StringBuffer("__1c");
        for (int i = 0; i < parts.length; i++) {
            int len = parts[i].length();
            if (len >= 26) {
                mangled.append((char)('a' + (len / 26)));
                len = len % 26;
            }
            mangled.append((char)('A' + len));
            mangled.append(parts[i]);
        }
        mangled.append("_");
        symbol = mangled.toString();
    }
    return VM.getVM().getDebugger().lookup(null, symbol);
}
 
Example #4
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
String fill(Address a, int width) {
    String s = "0x0";
    if (a != null) {
        s = a.toString();
    }
    if (s.length() != width) {
        return s.substring(0, 2) + "000000000000000000000".substring(0, width - s.length()) + s.substring(2);
    }
    return s;
}
 
Example #5
Source File: Disassembler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob, Address begin, Address end) {
   int codeSize = (int)end.minus(begin);
   long startPc = VM.getAddressValue(begin);
   byte[] code = new byte[codeSize];
   for (int i = 0; i < code.length; i++)
      code[i] = begin.getJByteAt(i);
   Disassembler dis = new Disassembler(startPc, code);
   dis.decode(visitor);
}
 
Example #6
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 2) {
        usage();
    } else {
        Type type = agent.getTypeDataBase().lookupType(t.nextToken());
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        CTypeTreeNodeAdapter node = new CTypeTreeNodeAdapter(a, type, null);

        out.println("pointer to " + type + " @ " + a +
                    " (size = " + type.getSize() + ")");
        printNode(node);
    }
}
 
Example #7
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
String fill(Address a, int width) {
    String s = "0x0";
    if (a != null) {
        s = a.toString();
    }
    if (s.length() != width) {
        return s.substring(0, 2) + "000000000000000000000".substring(0, width - s.length()) + s.substring(2);
    }
    return s;
}
 
Example #8
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        PointerLocation loc = PointerFinder.find(a);
        loc.printOn(out);
    }
}
 
Example #9
Source File: BsdDebuggerLocal.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
Example #10
Source File: CommandProcessor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #11
Source File: BasicTypeDataBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Address vtblForType(Type type) {
  Address vtblAddr = (Address)typeToVtbl.get(type);
  if (vtblAddr == null) {
    vtblAddr = vtblAccess.getVtblForType(type);
    if (vtblAddr != null) {
      typeToVtbl.put(type, vtblAddr);
    }
  }
  return vtblAddr;
}
 
Example #12
Source File: BsdDebuggerLocal.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
Example #13
Source File: CommandProcessor.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        Symbol.create(a).printValueOn(out);
        out.println();
    }
}
 
Example #14
Source File: CommandProcessor.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        HTMLGenerator gen = new HTMLGenerator(false);
        out.println(gen.genHTML(a));
    }
}
 
Example #15
Source File: CommandProcessor.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        PointerLocation loc = PointerFinder.find(a);
        loc.printOn(out);
    }
}
 
Example #16
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
String fill(Address a, int width) {
    String s = "0x0";
    if (a != null) {
        s = a.toString();
    }
    if (s.length() != width) {
        return s.substring(0, 2) + "000000000000000000000".substring(0, width - s.length()) + s.substring(2);
    }
    return s;
}
 
Example #17
Source File: CommandProcessor.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    int tokens = t.countTokens();
    if (tokens != 1) {
        usage();
        return;
    }
    Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
    Method m = (Method)Metadata.instantiateWrapperFor(a);
    HTMLGenerator html = new HTMLGenerator(false);
    out.println(html.genHTML(m));
}
 
Example #18
Source File: LinuxDebuggerLocal.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
Example #19
Source File: BasicTypeDataBase.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Type guessTypeForAddress(Address addr) {
  for (Iterator iter = getTypes(); iter.hasNext(); ) {
    Type t = (Type) iter.next();
    if (addressTypeIsEqualToType(addr, t)) {
      return t;
    }
  }
  return null;
}
 
Example #20
Source File: BsdDebuggerLocal.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** From the Debugger interface via JVMDebugger */
public Address parseAddress(String addressString)
        throws NumberFormatException {
    long addr = utils.scanAddress(addressString);
    if (addr == 0) {
        return null;
    }
    return new BsdAddress(this, addr);
}
 
Example #21
Source File: LinuxDebuggerLocal.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
Example #22
Source File: BsdDebuggerLocal.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/** From the SymbolLookup interface via Debugger and JVMDebugger */
public synchronized OopHandle lookupOop(String objectName, String symbol) {
    Address addr = lookup(objectName, symbol);
    if (addr == null) {
        return null;
    }
    return addr.addOffsetToAsOopHandle(0);
}
 
Example #23
Source File: BasicTypeDataBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Type guessTypeForAddress(Address addr) {
  for (Iterator iter = getTypes(); iter.hasNext(); ) {
    Type t = (Type) iter.next();
    if (addressTypeIsEqualToType(addr, t)) {
      return t;
    }
  }
  return null;
}
 
Example #24
Source File: Disassembler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void decode(InstructionVisitor visitor, CodeBlob blob, Address begin, Address end) {
   int codeSize = (int)end.minus(begin);
   long startPc = VM.getAddressValue(begin);
   byte[] code = new byte[codeSize];
   for (int i = 0; i < code.length; i++)
      code[i] = begin.getJByteAt(i);
   Disassembler dis = new Disassembler(startPc, code);
   dis.decode(visitor);
}
 
Example #25
Source File: CommandProcessor.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void doit(Tokens t) {
    if (t.countTokens() != 1) {
        usage();
    } else {
        Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
        HTMLGenerator gen = new HTMLGenerator(false);
        out.println(gen.genHTML(a));
    }
}
 
Example #26
Source File: HeapRegionSetBase.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public HeapRegionSetBase(Address addr) {
    super(addr);
}
 
Example #27
Source File: HeapRegionManager.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public HeapRegionManager(Address addr) {
    super(addr);
}
 
Example #28
Source File: G1CollectedHeap.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public G1MonitoringSupport g1mm() {
    Address g1mmAddr = g1mmField.getValue(addr);
    return (G1MonitoringSupport) VMObjectFactory.newObject(G1MonitoringSupport.class, g1mmAddr);
}
 
Example #29
Source File: BsdDebuggerLocal.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/** From the BsdDebugger interface */
public Address newAddress(long value) {
  if (value == 0) return null;
  return new BsdAddress(this, value);
}
 
Example #30
Source File: G1CollectedHeap.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public HeapRegionSetBase humongousSet() {
    Address humongousSetAddr = addr.addOffsetTo(humongousSetFieldOffset);
    return (HeapRegionSetBase) VMObjectFactory.newObject(HeapRegionSetBase.class,
                                                         humongousSetAddr);
}