本文整理汇总了Java中sun.jvm.hotspot.debugger.Address类的典型用法代码示例。如果您正苦于以下问题:Java Address类的具体用法?Java Address怎么用?Java Address使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Address类属于sun.jvm.hotspot.debugger包,在下文中一共展示了Address类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: lookup
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:19,代码来源:CommandProcessor.java
示例2: doit
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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));
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:19,代码来源:CommandProcessor.java
示例3: doit
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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);
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:CommandProcessor.java
示例4: parseAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** 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);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:10,代码来源:BsdDebuggerLocal.java
示例5: lookupOop
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** 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);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:9,代码来源:BsdDebuggerLocal.java
示例6: parseAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** 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 LinuxAddress(this, addr);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:10,代码来源:LinuxDebuggerLocal.java
示例7: vtblForType
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:BasicTypeDataBase.java
示例8: guessTypeForAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
public Type guessTypeForAddress(Address addr) {
for (Iterator iter = getTypes(); iter.hasNext(); ) {
Type t = (Type) iter.next();
if (addressTypeIsEqualToType(addr, t)) {
return t;
}
}
return null;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:BasicTypeDataBase.java
示例9: at
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
private HeapRegion at(long index) {
Address arrayAddr = regionsField.getValue(addr);
// Offset of &_region[index]
long offset = index * VM.getVM().getAddressSize();
Address regionAddr = arrayAddr.getAddressAt(offset);
return (HeapRegion) VMObjectFactory.newObject(HeapRegion.class,
regionAddr);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:9,代码来源:HeapRegionSeq.java
示例10: fill
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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;
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:11,代码来源:CommandProcessor.java
示例11: decode
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
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);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:10,代码来源:Disassembler.java
示例12: getAddressAt
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
protected Address getAddressAt(int index) {
if (index < 0 || index >= length()) throw new ArrayIndexOutOfBoundsException(index);
Type elemType = getElemType();
if (getElemType().isCIntegerType()) throw new RuntimeException("elemType must not be of CInteger type");
Address data = getAddress().addOffsetTo(dataFieldOffset);
long elemSize = elemType.getSize();
return data.getAddressAt(index * elemSize);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:GenericArray.java
示例13: getIntegerAt
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/**
* Gets the element at the given index.
*/
protected long getIntegerAt(int index) {
if (index < 0 || index >= length()) throw new ArrayIndexOutOfBoundsException(index + " " + length());
Type elemType = getElemType();
if (!getElemType().isCIntegerType()) throw new RuntimeException("elemType must be of CInteger type");
Address data = getAddress().addOffsetTo(dataFieldOffset);
long elemSize = elemType.getSize();
return data.getCIntegerAt(index * elemSize, elemSize, false);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:15,代码来源:GenericArray.java
示例14: getOopMapForReturnAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
public ImmutableOopMap getOopMapForReturnAddress(Address returnAddress, boolean debugging) {
Address pc = returnAddress;
if (Assert.ASSERTS_ENABLED) {
Assert.that(getOopMaps() != null, "nope");
}
return getOopMaps().findMapAtOffset(pc.minus(codeBegin()), debugging);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:CodeBlob.java
示例15: MethodArray
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
public MethodArray(Address addr) {
super(addr, dataFieldOffset);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:MethodArray.java
示例16: getThreadForIdentifierAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** From the ThreadAccess interface via Debugger and JVMDebugger */
public ThreadProxy getThreadForIdentifierAddress(Address threadIdAddr, Address uniqueThreadIdAddr) {
return new BsdThread(this, threadIdAddr, uniqueThreadIdAddr);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:5,代码来源:BsdDebuggerLocal.java
示例17: getAddressValue
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** From the BsdDebugger interface */
public long getAddressValue(Address addr) {
if (addr == null) return 0;
return ((BsdAddress) addr).getValue();
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:6,代码来源:BsdDebuggerLocal.java
示例18: newAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
/** From the BsdDebugger interface */
public Address newAddress(long value) {
if (value == 0) return null;
return new BsdAddress(this, value);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:6,代码来源:BsdDebuggerLocal.java
示例19: createLoadObject
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
private LoadObject createLoadObject(String fileName, long textsize,
long base) {
File f = new File(fileName);
Address baseAddr = newAddress(base);
return new SharedObject(this, fileName, f.length(), baseAddr);
}
开发者ID:arodchen,项目名称:MaxSim,代码行数:7,代码来源:LinuxDebuggerLocal.java
示例20: findDynamicTypeForAddress
import sun.jvm.hotspot.debugger.Address; //导入依赖的package包/类
public Type findDynamicTypeForAddress(Address addr, Type baseType) {
// This implementation should be suitably platform-independent; we
// search nearby memory for the vtbl value of the given type.
if (vtblForType(baseType) == null) {
// Type was not polymorphic which is an error of some sort
throw new InternalError(baseType + " does not appear to be polymorphic");
}
// This is a more restricted version of guessTypeForAddress since
// that function has some limitations since it doesn't really know
// where in the hierarchy a virtual type starts and just poking
// around in memory is likely to trip over some vtable address,
// resulting in false positives. Eventually all uses should
// switch to this logic but in the interests of stability it will
// be separate for the moment.
// Assuming that the base type is truly the first polymorphic type
// then the vtbl for all subclasss should be at several defined
// locations so only those locations will be checked. It's also
// required that the caller knows that the static type is at least
// baseType. See the notes in guessTypeForAddress for the logic of
// the locations searched.
Address loc1 = addr.getAddressAt(0);
Address loc2 = null;
Address loc3 = null;
long offset2 = baseType.getSize();
// I don't think this should be misaligned under any
// circumstances, but I'm not sure (FIXME: also not sure which
// way to go here, up or down -- assuming down)
offset2 = offset2 - (offset2 % getAddressSize()) - getAddressSize();
if (offset2 > 0) {
loc2 = addr.getAddressAt(offset2);
}
long offset3 = offset2 - getAddressSize();
if (offset3 > 0) {
loc3 = addr.getAddressAt(offset3);
}
Type loc2Match = null;
Type loc3Match = null;
for (Iterator iter = getTypes(); iter.hasNext(); ) {
Type type = (Type) iter.next();
Type superClass = type;
while (superClass != baseType && superClass != null) {
superClass = superClass.getSuperclass();
}
if (superClass == null) continue;
Address vtblAddr = vtblForType(type);
if (vtblAddr == null) {
// This occurs sometimes for intermediate types that are never
// instantiated.
if (DEBUG) {
System.err.println("null vtbl for " + type);
}
continue;
}
// Prefer loc1 match
if (vtblAddr.equals(loc1)) return type;
if (loc2 != null && loc2Match == null && vtblAddr.equals(loc2)) {
loc2Match = type;
}
if (loc3 != null && loc3Match == null && vtblAddr.equals(loc3)) {
loc3Match = type;
}
}
if (loc2Match != null) return loc2Match;
if (loc3Match != null) return loc3Match;
return null;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:72,代码来源:BasicTypeDataBase.java
注:本文中的sun.jvm.hotspot.debugger.Address类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论