Skip to content

Commit e324ab1

Browse files
authored
Exit debugger session when the child process ends (#100)
1 parent e6e4cd8 commit e324ab1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ class RdbgAdapterDescriptorFactory implements DebugAdapterDescriptorFactory {
371371
const rdbg = config.rdbgPath || "rdbg";
372372
const command = this.make_shell_command(rdbg + " --util=gen-sockpath");
373373
const p = child_process.exec(command, {
374-
cwd: config.cwd ? custom_path(config.cwd) : workspace_folder() ,
374+
cwd: config.cwd ? custom_path(config.cwd) : workspace_folder(),
375375
env: { ...process.env, ...config.env }
376376
});
377377
let path: string;
@@ -776,6 +776,9 @@ class RdbgAdapterDescriptorFactory implements DebugAdapterDescriptorFactory {
776776
debugConsole.append(err.message);
777777
reject(err);
778778
});
779+
debugProcess.on('exit', (code) => {
780+
reject(new Error(`Couldn't start debug session. The debuggee process exited with code ${code}`));
781+
});
779782
});
780783
}
781784

@@ -813,6 +816,9 @@ class RdbgAdapterDescriptorFactory implements DebugAdapterDescriptorFactory {
813816
debugConsole.append(err.message);
814817
reject(err);
815818
});
819+
debugProcess.on('exit', (code) => {
820+
reject(new Error(`Couldn't start debug session. The debuggee process exited with code ${code}`));
821+
});
816822
});
817823
}
818824
}

0 commit comments

Comments
 (0)