fix debug stopping

This commit is contained in:
Vadim Lopatin 2015-12-16 16:57:53 +03:00
parent 94ae71b7e8
commit b8b44a79e7
1 changed files with 9 additions and 6 deletions

View File

@ -25,6 +25,7 @@ class DebuggerUIHandler : DebuggerCallback {
/// called when program execution is stopped /// called when program execution is stopped
void onProgramExecutionStatus(ProgramExecution process, ExecutionStatus status, int exitCode) { void onProgramExecutionStatus(ProgramExecution process, ExecutionStatus status, int exitCode) {
Log.d("Debugger exit status: ", status, " ", exitCode); Log.d("Debugger exit status: ", status, " ", exitCode);
updateLocation(null);
_ide.debugFinished(process, status, exitCode); _ide.debugFinished(process, status, exitCode);
//_callbackDelegate( delegate() { _callback.onProgramExecutionStatus(this, status, exitCode); } ); //_callbackDelegate( delegate() { _callback.onProgramExecutionStatus(this, status, exitCode); } );
} }
@ -49,15 +50,17 @@ class DebuggerUIHandler : DebuggerCallback {
void updateLocation(DebugLocation location) { void updateLocation(DebugLocation location) {
_location = location; _location = location;
ProjectSourceFile sourceFile = currentWorkspace.findSourceFile(location.projectFilePath, location.fullFilePath); ProjectSourceFile sourceFile = location ? currentWorkspace.findSourceFile(location.projectFilePath, location.fullFilePath) : null;
if (location) {
if (sourceFile) { if (sourceFile) {
_ide.openSourceFile(sourceFile.filename, sourceFile, true); _ide.openSourceFile(sourceFile.filename, sourceFile, true);
} else { } else {
_ide.openSourceFile(location.fullFilePath, null, true); _ide.openSourceFile(location.fullFilePath, null, true);
} }
}
DSourceEdit[] editors = _ide.allOpenedEditors; DSourceEdit[] editors = _ide.allOpenedEditors;
foreach(ed; editors) { foreach(ed; editors) {
if (ed.projectSourceFile is sourceFile) if (location && ed.projectSourceFile is sourceFile)
ed.executionLine = location.line - 1; ed.executionLine = location.line - 1;
else else
ed.executionLine = -1; ed.executionLine = -1;