Skip to content

Commit 93ed3f2

Browse files
author
Miro Bucko
committed
Report exit status message in lldb-dap, same as lldb cli
Summary: When the target inferior process that is being debugged exits in lldb command line, it emits following message: Process 4049526 exited with status = -1 (0xffffffff) debugserver died with signal SIGTERM lldb-dap on the other hand does not emit a similar message. This PR adds the same status message to lldb-dap. Test Plan: In VSCode debug any target and hit stop mode, kill lldb-server and observe an exit status message similar to the following: Process 2167677 exited with status = -1 (0xffffffff) debugserver died with signal SIGTERM Reviewers: Subscribers: Tasks: lldb-dap Tags:
1 parent 3a4bc11 commit 93ed3f2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/tools/lldb-dap/lldb-dap.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,13 @@ void EventThreadFunction() {
503503
SendContinuedEvent();
504504
break;
505505
case lldb::eStateExited:
506+
const int exit_status = process.GetExitStatus();
507+
const char * const exit_description = process.GetExitDescription();
508+
g_dap.SendFormattedOutput(OutputType::Console,
509+
"Process %" PRIu64 " exited with status = %i (0x%8.8x) %s\n",
510+
process.GetProcessID(), exit_status, exit_status,
511+
exit_description ? exit_description : "");
512+
506513
// When restarting, we can get an "exited" event for the process we
507514
// just killed with the old PID, or even with no PID. In that case
508515
// we don't have to terminate the session.

0 commit comments

Comments
 (0)