--- old/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java 2018-10-11 19:51:28.000000000 -0700 +++ new/src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java 2018-10-11 19:51:27.000000000 -0700 @@ -100,6 +100,12 @@ public void breakpointEvent(BreakpointEvent be) { Thread.yield(); // fetch output MessageOutput.lnprint("Breakpoint hit:"); + // Print current location and prompt if suspend policy is SUSPEND_EVENT_THREAD. + // In case of SUSPEND_ALL policy this is handled by vmInterrupted() method. + if (be.request().suspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD) { + printCurrentLocation(ThreadInfo.getThreadInfo(be.thread())); + MessageOutput.printPrompt(); + } } @Override @@ -227,8 +233,7 @@ Commands.locationString(loc)}); } - private void printCurrentLocation() { - ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo(); + private void printCurrentLocation(ThreadInfo threadInfo) { StackFrame frame; try { frame = threadInfo.getCurrentFrame(); @@ -259,6 +264,10 @@ MessageOutput.println(); } + private void printCurrentLocation() { + printCurrentLocation(ThreadInfo.getCurrentThreadInfo()); + } + private void printLocationOfEvent(LocatableEvent theEvent) { printBaseLocation(theEvent.thread().name(), theEvent.location()); }