[Lldb-commits] [PATCH] D126615: [lldb] Add an integration test for non-stop protocol

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 18 08:08:16 PDT 2022


mgorny updated this revision to Diff 445512.
mgorny added a comment.

Update again ;-).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126615/new/

https://reviews.llvm.org/D126615

Files:
  lldb/test/Shell/Process/Inputs/signal.c
  lldb/test/Shell/Process/TestNonStop.test


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)
Index: lldb/test/Shell/Process/Inputs/signal.c
===================================================================
--- /dev/null
+++ lldb/test/Shell/Process/Inputs/signal.c
@@ -0,0 +1,13 @@
+#include <assert.h>
+#include <signal.h>
+#include <stdio.h>
+
+void handler() {
+  printf("got SIGINT\n");
+}
+
+int main() {
+  assert(signal(SIGINT, handler) != SIG_ERR);
+  raise(SIGINT);
+  return 42;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126615.445512.patch
Type: text/x-patch
Size: 2215 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220718/36aac014/attachment.bin>


More information about the lldb-commits mailing list