System.out.println("Thread not found: " + threadName);
return;
}
}
VmThread vmThread = ThreadHelper.getVmThread(thread);
final int stackSize = vmThread.getStackSize();
final Object stack = invoke("getStack", VmThread.class, vmThread);
if (stack != null) {
final Address stackBottom = ObjectReference.fromObject(stack).toAddress();
final Address stackTop = stackBottom.add(stackSize);
final Address stackEnd;
if (vmThread == VmThread.currentThread()) {
stackEnd = stackBottom;
} else {
stackEnd = ((VmX86Thread) vmThread).getStackPointer();
}
final int slotSize = (Integer) invoke("getReferenceSize", VmX86Thread.class, vmThread);
Address stackFrame = vmThread.getStackFrame();
System.out.println("Stack start: " + NumberUtils.hex(stackTop.toInt()));
System.out.println("Stack end : " + NumberUtils.hex(stackEnd.toInt()));
System.out.println("Raw stack:");
Address ptr = stackTop;