Index: lldb/test/Shell/Process/Inputs/signal.c =================================================================== --- /dev/null +++ lldb/test/Shell/Process/Inputs/signal.c @@ -0,0 +1,13 @@ +#include +#include +#include + +void handler() { + printf("got SIGINT\n"); +} + +int main() { + assert(signal(SIGINT, handler) != SIG_ERR); + raise(SIGINT); + return 42; +} Index: lldb/test/Shell/Process/TestNonStop.test =================================================================== --- /dev/null +++ lldb/test/Shell/Process/TestNonStop.test @@ -0,0 +1,35 @@ +# UNSUPPORTED: lldb-repro +# REQUIRES: native +# RUN: %clang_host %p/Inputs/signal.c -o %t +# RUN: %lldb -b -s %s %t | FileCheck %s +settings set plugin.process.gdb-remote.use-non-stop-protocol true +log enable gdb-remote packets +process launch + +# CHECK: lldb < 14> send packet: $QNonStop:1#8d +# CHECK-NEXT: lldb < 6> read packet: $OK#9a + +# CHECK: b-remote.async> < 5> send packet: $c#63 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a +# CHECK-NEXT: b-remote.async> <{{[ 0-9]+}}> read packet: %Stop:T{{.*}} +# CHECK-NEXT: b-remote.async> < 12> send packet: $vStopped#55 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a +# CHECK-NEXT: b-remote.async> < 11> send packet: $vCont;t#b9 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a +# CHECK-NEXT: b-remote.async> < 5> send packet: $?#3f +# CHECK-NEXT: b-remote.async> <{{[ 0-9]+}}> read packet: $T{{.*}} +# CHECK-NEXT: b-remote.async> < 12> send packet: $vStopped#55 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a + +# CHECK: * thread #1, name = '{{.*}}', stop reason = signal SIGINT + +process continue + +# CHECK: b-remote.async> < 5> send packet: $c#63 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a +# CHECK-NEXT: b-remote.async> <{{[ 0-9]+}}> read packet: %Stop:W2a;process:{{.*}} +# CHECK-NEXT: b-remote.async> < 12> send packet: $vStopped#55 +# CHECK-NEXT: b-remote.async> < 6> read packet: $OK#9a +# CHECK-NOT: b-remote.async> < 11> send packet: $vCont;t#b9 + +# CHECK: Process {{[0-9]+}} exited with status = 42 (0x0000002a)