Skip to content

Commit 5288c94

Browse files
authored
Merge pull request #1938 from Teemperor/cherry/f0699d9109143754088c26604c58f5ab3e9d4678
Backport [debugserver] Fix that debugserver's stop reply packets always return signal code 0
2 parents d38d7b6 + a9014a9 commit 5288c94

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <stdlib.h>
2+
3+
int main(int argc, char **argv) { abort(); }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
UNSUPPORTED: system-windows
2+
3+
RUN: %clang_host %p/Inputs/abort.c -o %t
4+
RUN: %lldb %t -o run -o continue | FileCheck %s
5+
6+
CHECK: status = 6 (0x00000006)

lldb/tools/debugserver/source/RNBRemote.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3066,7 +3066,7 @@ rnb_err_t RNBRemote::HandlePacket_last_signal(const char *unused) {
30663066
WEXITSTATUS(pid_status));
30673067
else if (WIFSIGNALED(pid_status))
30683068
snprintf(pid_exited_packet, sizeof(pid_exited_packet), "X%02x",
3069-
WEXITSTATUS(pid_status));
3069+
WTERMSIG(pid_status));
30703070
else if (WIFSTOPPED(pid_status))
30713071
snprintf(pid_exited_packet, sizeof(pid_exited_packet), "S%02x",
30723072
WSTOPSIG(pid_status));

0 commit comments

Comments
 (0)