CHE-5235: Fix step into when source cannot be obtained (#5768)

CHE-5235: Fix step into when source cannot be obtained.
6.19.x
Mykola Morhun 2017-07-21 15:43:06 +03:00 committed by GitHub
parent b485ed3e0f
commit 84a4de633d
2 changed files with 18 additions and 1 deletions

View File

@ -215,6 +215,18 @@ public abstract class AbstractDebugger implements Debugger, DebuggerObservable {
}
private void openCurrentFile() {
// Handle the situation when resource isn't found in the workspace
// It means that it is impossible to open it.
if (currentLocation.getResourcePath() == null) {
for (DebuggerObserver observer : observers) {
observer.onBreakpointStopped(currentLocation.getTarget(),
currentLocation.getTarget(),
currentLocation.getLineNumber());
}
return;
}
//todo we need add possibility to handle few files
activeFileHandler.openFile(currentLocation,
new AsyncCallback<VirtualFile>() {

View File

@ -596,7 +596,12 @@ public class JavaDebugger implements EventsHandler, Debugger {
setCurrentThread(event.thread());
com.sun.jdi.Location jdiLocation = event.location();
Location location = debuggerUtil.getLocation(jdiLocation);
Location location;
try {
location = debuggerUtil.getLocation(jdiLocation);
} catch (DebuggerException de) {
location = new LocationImpl(jdiLocation.declaringType().name(), jdiLocation.lineNumber());
}
debuggerCallback.onEvent(new SuspendEventImpl(location));
return false;
}