use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class ThreadsCommand method search.
private void search(PrintStream out, UDATA tid) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9VMThreadPointer mainThread = vm.mainThread();
if (mainThread.notNull()) {
J9VMThreadPointer threadCursor = vm.mainThread();
do {
if (threadCursor.osThread().tid().eq(tid)) {
out.println(String.format("\t!stack 0x%08x\t!j9vmthread 0x%08x\t!j9thread 0x%08x\ttid 0x%x (%d) // %s", threadCursor.getAddress(), threadCursor.getAddress(), threadCursor.osThread().getAddress(), threadCursor.osThread().tid().longValue(), threadCursor.osThread().tid().longValue(), getThreadName(threadCursor)));
break;
}
threadCursor = threadCursor.linkNext();
} while (!threadCursor.eq(mainThread));
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class ThreadsCommand method flags.
private void flags(PrintStream out) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9VMThreadPointer mainThread = vm.mainThread();
if (mainThread.notNull()) {
J9VMThreadPointer threadCursor = vm.mainThread();
do {
out.append(String.format(" !j9vmthread 0x%s publicFlags=%s privateFlags=%s // %s", Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.publicFlags().longValue()), Long.toHexString(threadCursor.privateFlags().longValue()), getThreadName(threadCursor)));
out.append(nl);
threadCursor = threadCursor.linkNext();
} while (!threadCursor.eq(mainThread));
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class ThreadsCommand method trace.
private void trace(PrintStream out) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9VMThreadPointer mainThread = vm.mainThread();
if (mainThread.notNull()) {
J9VMThreadPointer threadCursor = vm.mainThread();
do {
out.append(String.format(" !stack 0x%s !j9vmthread 0x%s !j9thread 0x%s tid 0x%s (%d) !utthreaddata 0x%s // %s", Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.getAddress()), Long.toHexString(threadCursor.osThread().getAddress()), Long.toHexString(threadCursor.osThread().tid().longValue()), threadCursor.osThread().tid().longValue(), Long.toHexString(threadCursor.omrVMThread()._trace$uteThread().getAddress()), getThreadName(threadCursor)));
out.append(nl);
threadCursor = threadCursor.linkNext();
} while (!threadCursor.eq(mainThread));
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class ThreadsCommand method monitors.
/**
* Prints all of the J9ObjectMonitors in the list of monitor tables.
*
* NOTE: It does not dump system monitors found in the thread lib monitor_pool
*
* @param out the PrintStream to write output to
*
* @see {@link MonitorsCommand}
*/
private void monitors(PrintStream out) throws DDRInteractiveCommandException {
try {
MonitorTableListIterator iterator = new MonitorTableListIterator();
MonitorTable previousMonitorTable = null;
while (iterator.hasNext()) {
J9ObjectMonitorPointer objectMonitorPointer = iterator.next();
MonitorTable currentMonitorTable = iterator.currentMonitorTable();
if (!currentMonitorTable.equals(previousMonitorTable)) {
/* Print header for new monitor table */
out.append("Table = " + currentMonitorTable.getTableName() + ", itemCount=" + currentMonitorTable.getCount());
out.append(nl);
}
out.append(String.format("\n !j9thread 0x%s !j9threadmonitor 0x%s", Long.toHexString(objectMonitorPointer.monitor().owner().getAddress()), Long.toHexString(objectMonitorPointer.monitor().getAddress())));
out.append(nl);
previousMonitorTable = currentMonitorTable;
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.CorruptDataException in project openj9 by eclipse.
the class ThreadsCommand method stack.
private void stack(PrintStream out, Context context, String command) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9VMThreadPointer mainThread = vm.mainThread();
StackWalkCommand walkCommand = new StackWalkCommand();
if (mainThread.notNull()) {
J9VMThreadPointer threadCursor = vm.mainThread();
do {
out.println(String.format("\t!stack 0x%08x\t!j9vmthread 0x%08x\t!j9thread 0x%08x\ttid 0x%x (%d) // %s", threadCursor.getAddress(), threadCursor.getAddress(), threadCursor.osThread().getAddress(), threadCursor.osThread().tid().longValue(), threadCursor.osThread().tid().longValue(), getThreadName(threadCursor)));
out.append(nl);
walkCommand.run(command, new String[] { Long.toString(threadCursor.getAddress()) }, context, out);
out.append(nl);
threadCursor = threadCursor.linkNext();
} while (!threadCursor.eq(mainThread));
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
Aggregations