summaryrefslogtreecommitdiffstats
path: root/lldb/test/Shell
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-07 15:28:30 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-10 11:16:52 -0800
commite81268d03e73aef4f9c7bd8ece8ad02f5b017dcf (patch)
treecd875ff5d4d81e0f45178c3dfc1e32a7e3950de0 /lldb/test/Shell
parent21b43885b81a6180e7231e575b5433202582f2fb (diff)
downloadbcm5719-llvm-e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf.tar.gz
bcm5719-llvm-e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf.zip
[lldb/Reproducers] Support multiple GDB remotes
When running the test suite with always capture on, a handful of tests are failing because they have multiple targets and therefore multiple GDB remote connections. The current reproducer infrastructure is capable of dealing with that. This patch reworks the GDB remote provider to support multiple GDB remote connections, similar to how the reproducers support shadowing multiple command interpreter inputs. The provider now keeps a list of packet recorders which deal with a single GDB remote connection. During replay we rely on the order of creation to match the number of packets to the GDB remote connection. Differential revision: https://reviews.llvm.org/D71105
Diffstat (limited to 'lldb/test/Shell')
-rw-r--r--lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in12
-rw-r--r--lldb/test/Shell/Reproducer/TestMultipleTargets.test23
2 files changed, 35 insertions, 0 deletions
diff --git a/lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in b/lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
new file mode 100644
index 00000000000..c78d6276c89
--- /dev/null
+++ b/lldb/test/Shell/Reproducer/Inputs/MultipleTargetsCapture.in
@@ -0,0 +1,12 @@
+target select 0
+breakpoint set -f simple.c -l 12
+run
+target select 1
+breakpoint set -f simple.c -l 16
+run
+target select 0
+cont
+target select 1
+cont
+reproducer status
+reproducer generate
diff --git a/lldb/test/Shell/Reproducer/TestMultipleTargets.test b/lldb/test/Shell/Reproducer/TestMultipleTargets.test
new file mode 100644
index 00000000000..f36dbf6b5c4
--- /dev/null
+++ b/lldb/test/Shell/Reproducer/TestMultipleTargets.test
@@ -0,0 +1,23 @@
+# UNSUPPORTED: system-windows, system-freebsd
+
+# This tests the replaying with multiple targets.
+
+# RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
+
+# RUN: rm -rf %t.repro
+# RUN: %lldb -x -b --capture --capture-path %t.repro -o 'target create %t.out' -o 'target create %t.out' -s %S/Inputs/MultipleTargetsCapture.in | FileCheck %s --check-prefix CHECK --check-prefix CAPTURE
+# RUN: env FOO=BAR %lldb --replay %t.repro | FileCheck %s --check-prefix CHECK --check-prefix REPLAY
+
+# CHECK: Process [[TARGET0:[0-9]+]] stopped
+# CHECK: stop reason = breakpoint 1.1
+# CHECK: simple.c:12:5
+# CHECK: Process [[TARGET1:[0-9]+]] stopped
+# CHECK: stop reason = breakpoint 1.1
+# CHECK: simple.c:16:5
+# CHECK: Process [[TARGET0]] resuming
+# CHECK: Process [[TARGET0]] exited
+# CHECK: Process [[TARGET1]] resuming
+# CHECK: Process [[TARGET1]] exited
+
+# CAPTURE: Reproducer is in capture mode.
+# CAPTURE: Reproducer written
OpenPOWER on IntegriCloud