use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class MarkMapCommand method fromBits.
protected void fromBits(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
UDATAPointer markSlot = UDATAPointer.cast(address);
UDATAPointer base = markMap.getHeapMapBits();
UDATA maxOffset = markMap.getSlotIndexAndMask(J9ObjectPointer.cast(markMap.getHeapTop().subOffset(markMap.getObjectGrain())))[0];
maxOffset = maxOffset.add(1);
UDATAPointer top = base.add(maxOffset);
if (markSlot.gte(base) && markSlot.lte(top)) {
IDATA delta = markSlot.sub(base);
int pageSize = markMap.getPageSize(null);
// obviously not right for metronome
delta = delta.mult(pageSize);
J9ObjectPointer rangeBase = J9ObjectPointer.cast(markMap.getHeapBase().addOffset(delta));
J9ObjectPointer rangeTop = rangeBase.addOffset(pageSize);
out.format("Mark bits at %s corresponds to heap range %s -> %s\n", markSlot.getHexAddress(), rangeBase.getHexAddress(), rangeTop.getHexAddress());
} else {
out.format("Address %s is not in the mark map\n", markSlot.getHexAddress());
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class RootPathCommand method objectToString.
public static String objectToString(J9ObjectPointer object) throws CorruptDataException {
J9ClassPointer clazz = J9ObjectHelper.clazz(object);
StringWriter buf = new StringWriter();
String className;
className = J9ClassHelper.getJavaName(clazz);
if (className.equals("java/lang/Class")) {
buf.write("class ");
buf.write(J9ClassHelper.getJavaName(ConstantPoolHelpers.J9VM_J9CLASS_FROM_HEAPCLASS(object)));
buf.write('@');
buf.write(object.getHexAddress());
} else if (className.equals("java/lang/String")) {
buf.write('"');
buf.write(J9ObjectHelper.stringValue(object));
buf.write("\"@");
buf.write(object.getHexAddress());
} else {
buf.write(className);
buf.write('@');
buf.write(object.getHexAddress());
if (ObjectModel.isIndexable(object)) {
buf.write(" = ");
buf.write(J9IndexableObjectHelper.getDataAsString(J9IndexableObjectPointer.cast(object)));
}
}
return buf.toString();
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class SearchStringTableCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
if (1 == args.length) {
J9ObjectPointer objectPointer = J9ObjectPointer.cast(CommandUtils.parsePointer(args[0], J9BuildFlags.env_data64));
J9ObjectPointer data = StringTable.from().search(objectPointer);
if (data.notNull()) {
String stringValue = J9ObjectHelper.stringValue(data);
String hexAddr = data.formatShortInteractive();
out.println(String.format("%s <%s>", hexAddr, stringValue));
} else {
out.println("Not found");
}
} else {
throw new DDRInteractiveCommandException("This debug extension needs an address argument !searchstringtable <addr>");
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class MarkMapCommand method markBits.
protected void markBits(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
J9ObjectPointer object = J9ObjectPointer.cast(address);
J9ObjectPointer base = J9ObjectPointer.cast(address).untag(markMap.getPageSize(object) - 1);
J9ObjectPointer top = base.addOffset(markMap.getPageSize(object));
MarkedObject[] result = markMap.queryRange(base, top);
if (result.length > 0) {
if (result[0].wasRelocated()) {
out.format("Mark bits for the compacted range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), result[0].markBitsSlot.getHexAddress());
} else {
out.format("Mark bits for the range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), result[0].markBitsSlot.getHexAddress());
}
} else {
/* Either outside the heap, or just nothing there */
try {
UDATA[] indexAndMask = markMap.getSlotIndexAndMask(base);
UDATAPointer markBitsSlot = markMap.getHeapMapBits().add(indexAndMask[0]);
out.format("Mark bits for the range %s -> %s: !j9x %s\n", base.getHexAddress(), top.getHexAddress(), markBitsSlot.getHexAddress());
} catch (IllegalArgumentException ex) {
out.format("Object %s is not in the heap\n", object.getHexAddress());
}
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class MarkMapCommand method scanRange.
protected void scanRange(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
long baseAddress = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
long topAddress = CommandUtils.parsePointer(args[2], J9BuildFlags.env_data64);
J9ObjectPointer base = J9ObjectPointer.cast(baseAddress);
J9ObjectPointer top = J9ObjectPointer.cast(topAddress);
MarkedObject[] results = markMap.queryRange(base, top);
reportResults(base, top, results, out);
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
Aggregations