use of com.ibm.dtfj.image.DataUnavailable in project openj9 by eclipse.
the class InfoHeapCommand method printSectionInfo.
private void printSectionInfo(JavaHeap theHeap, PrintStream out) {
Iterator itSections = theHeap.getSections();
int countSections = 1;
while (itSections.hasNext()) {
ImageSection theSection = (ImageSection) itSections.next();
out.print("\t Section #" + countSections + ": " + theSection.getName() + "\n");
out.print("\t Size: " + theSection.getSize() + " bytes\n");
try {
out.print("\t Shared: " + theSection.isShared() + "\n");
out.print("\t Executable: " + theSection.isExecutable() + "\n");
out.print("\t Read Only: " + theSection.isReadOnly() + "\n");
} catch (DataUnavailable e) {
out.print("\t Shared: <unknown>\n");
out.print("\t Executable: <unknown>\n");
out.print("\t Read Only: <unknown>\n");
}
countSections++;
}
}
use of com.ibm.dtfj.image.DataUnavailable in project openj9 by eclipse.
the class WhatisCommand method isWithinImageSections.
private boolean isWithinImageSections(Iterator heapImageSections, Object memType, boolean isMethodCompiled, long address) {
while (heapImageSections.hasNext()) {
ImageSection imageSection = (ImageSection) heapImageSections.next();
long baseAddress = imageSection.getBaseAddress().getAddress();
long size = imageSection.getSize();
long endAddress = baseAddress + size;
if (address <= endAddress && address >= baseAddress) {
if (null == memType) {
out.print("\t\t0x" + Long.toHexString(address) + " is within heap segment: " + Long.toHexString(baseAddress) + " -- " + Long.toHexString(endAddress) + "\n");
return true;
}
if (memType instanceof JavaMethod) {
String methodName = "N/A", methodSig = "N/A", className = "N/A";
try {
methodName = ((JavaMethod) memType).getName();
methodSig = ((JavaMethod) memType).getSignature();
className = ((JavaMethod) memType).getDeclaringClass().getName();
} catch (CorruptDataException cde) {
} catch (DataUnavailable du) {
}
String codeType = isMethodCompiled ? "compiled code" : "byte code";
out.print("\t0x" + Long.toHexString(address) + " is within the " + codeType + " range: " + Long.toHexString(baseAddress) + " -- " + Long.toHexString(endAddress) + "\n\t" + "...of method " + methodName + " with signature " + methodSig + "\n\t" + "...in class " + className + "\n");
return true;
}
}
}
return false;
}
use of com.ibm.dtfj.image.DataUnavailable in project openj9 by eclipse.
the class JUCMonitorNode method getEnterWaiters.
public Iterator getEnterWaiters() {
List waiters = new LinkedList();
Iterator itThread = jr.getThreads();
while (itThread.hasNext()) {
Object o = itThread.next();
try {
if (!(o instanceof JavaThread)) {
continue;
}
JavaThread jt = (JavaThread) o;
if ((jt.getState() & JavaThread.STATE_PARKED) != 0) {
JavaObject blocker = jt.getBlockingObject();
if (blocker != null && blocker.equals(lock)) {
waiters.add(jt);
}
}
} catch (CorruptDataException cde) {
// out.println("\nwarning, corrupt data encountered during scan for java.util.concurrent locks...");
} catch (DataUnavailable du) {
// out.println("\nwarning, data unavailable encountered during scan for java.util.concurrent locks...");
}
}
return waiters.iterator();
}
use of com.ibm.dtfj.image.DataUnavailable in project openj9 by eclipse.
the class InfoSymCommand method printModule.
private void printModule(ImageModule imageModule, boolean printSymbols) {
try {
out.print("\t " + imageModule.getName());
} catch (CorruptDataException cde) {
out.print("\t " + Exceptions.getCorruptDataExceptionString());
}
try {
String addressInHex = String.format("0x%x", imageModule.getLoadAddress());
out.print(" @ " + addressInHex);
} catch (DataUnavailable e) {
// if we do not have the load address, simply omit it
} catch (CorruptDataException e) {
// if we do not have the load address, simply omit it
}
Iterator itSection = imageModule.getSections();
if (itSection.hasNext()) {
out.print(", sections:\n");
} else {
out.print(", <no section information>\n");
}
// iterate through the library sections
while (itSection.hasNext()) {
Object next = itSection.next();
if (next instanceof ImageSection) {
ImageSection is = (ImageSection) next;
out.print("\t 0x" + Long.toHexString(is.getBaseAddress().getAddress()) + " - 0x" + Long.toHexString(is.getBaseAddress().getAddress() + is.getSize()));
out.print(", name: \"");
out.print(is.getName());
out.print("\", size: 0x");
out.print(Long.toHexString(is.getSize()));
out.print("\n");
} else if (next instanceof CorruptData) {
// warn the user that this image section is corrupt
out.print("\t <corrupt section encountered>\n");
} else {
// unexpected type in iterator
out.print("\t <corrupt section encountered>\n");
}
}
if (printSymbols) {
out.print("\t " + "symbols:\n");
Iterator itSymbols = imageModule.getSymbols();
while (itSymbols.hasNext()) {
Object next = itSymbols.next();
if (next instanceof ImageSymbol) {
ImageSymbol is = (ImageSymbol) next;
out.print("\t 0x" + Long.toHexString(is.getAddress().getAddress()));
out.print(", name: \"");
out.print(is.getName());
out.print("\"\n");
} else if (next instanceof CorruptData) {
// warn the user that this image section is corrupt
out.print("\t <corrupt symbol encountered>\n");
} else {
// unexpected type in iterator
out.print("\t <corrupt symbol encountered>\n");
}
}
}
out.print("\n");
}
use of com.ibm.dtfj.image.DataUnavailable in project openj9 by eclipse.
the class InfoThreadCommand method printProcessInfo.
private void printProcessInfo(String id, Map threads) {
Iterator itProcess;
ImageProcess ip;
boolean found = false;
ip = ctx.getProcess();
_pointerSize = ip.getPointerSize();
out.print(" process id: ");
try {
out.print(ip.getID());
} catch (DataUnavailable d) {
out.print(Exceptions.getDataUnavailableString());
} catch (CorruptDataException e) {
out.print(Exceptions.getCorruptDataExceptionString());
}
out.print("\n\n");
found = printThreadInfo(id, threads);
if (!found) {
out.print(" no native threads found with specified id\n");
}
}
Aggregations