Skip to content

Commit 84a4de6

Browse files
authored
CHE-5235: Fix step into when source cannot be obtained (eclipse-che#5768)
CHE-5235: Fix step into when source cannot be obtained.
1 parent b485ed3 commit 84a4de6

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

  • plugins
    • plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug
    • plugin-java-debugger/che-plugin-java-debugger-server/src/main/java/org/eclipse/che/plugin/jdb/server

plugins/plugin-debugger/che-plugin-debugger-ide/src/main/java/org/eclipse/che/plugin/debugger/ide/debug/AbstractDebugger.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ private void onEventListReceived(@NotNull DebuggerEventDto event) {
215215
}
216216

217217
private void openCurrentFile() {
218+
// Handle the situation when resource isn't found in the workspace
219+
// It means that it is impossible to open it.
220+
if (currentLocation.getResourcePath() == null) {
221+
for (DebuggerObserver observer : observers) {
222+
observer.onBreakpointStopped(currentLocation.getTarget(),
223+
currentLocation.getTarget(),
224+
currentLocation.getLineNumber());
225+
}
226+
227+
return;
228+
}
229+
218230
//todo we need add possibility to handle few files
219231
activeFileHandler.openFile(currentLocation,
220232
new AsyncCallback<VirtualFile>() {

plugins/plugin-java-debugger/che-plugin-java-debugger-server/src/main/java/org/eclipse/che/plugin/jdb/server/JavaDebugger.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,12 @@ private boolean processStepEvent(com.sun.jdi.event.StepEvent event) throws Debug
596596
setCurrentThread(event.thread());
597597
com.sun.jdi.Location jdiLocation = event.location();
598598

599-
Location location = debuggerUtil.getLocation(jdiLocation);
599+
Location location;
600+
try {
601+
location = debuggerUtil.getLocation(jdiLocation);
602+
} catch (DebuggerException de) {
603+
location = new LocationImpl(jdiLocation.declaringType().name(), jdiLocation.lineNumber());
604+
}
600605
debuggerCallback.onEvent(new SuspendEventImpl(location));
601606
return false;
602607
}

0 commit comments

Comments
 (0)