Skip to content

Backport [debugserver] Fix that debugserver's stop reply packets always return signal code 0 #1938

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lldb/test/Shell/Process/Inputs/abort.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <stdlib.h>

int main(int argc, char **argv) { abort(); }
6 changes: 6 additions & 0 deletions lldb/test/Shell/Process/TestAbortExitCode.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
UNSUPPORTED: system-windows

RUN: %clang_host %p/Inputs/abort.c -o %t
RUN: %lldb %t -o run -o continue | FileCheck %s

CHECK: status = 6 (0x00000006)
2 changes: 1 addition & 1 deletion lldb/tools/debugserver/source/RNBRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3066,7 +3066,7 @@ rnb_err_t RNBRemote::HandlePacket_last_signal(const char *unused) {
WEXITSTATUS(pid_status));
else if (WIFSIGNALED(pid_status))
snprintf(pid_exited_packet, sizeof(pid_exited_packet), "X%02x",
WEXITSTATUS(pid_status));
WTERMSIG(pid_status));
else if (WIFSTOPPED(pid_status))
snprintf(pid_exited_packet, sizeof(pid_exited_packet), "S%02x",
WSTOPSIG(pid_status));
Expand Down