[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
Sun May 29 07:29:12 PDT 2022


mgorny created this revision.
mgorny added reviewers: labath, krytarowski, emaste.
Herald added a subscriber: arichardson.
Herald added a project: All.
mgorny requested review of this revision.

Sponsored by: The FreeBSD Foundation


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,30 @@
+# 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>  <  10> send packet: $vCtrlC#4e
+# 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>  <  12> read packet: %Stop:W2a#ea
+# CHECK-NEXT: b-remote.async>  <  12> send packet: $vStopped#55
+# CHECK-NEXT: b-remote.async>  <   6> read packet: $OK#9a
+
+# 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.432789.patch
Type: text/x-patch
Size: 1881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220529/16d892e5/attachment.bin>


More information about the lldb-commits mailing list