aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-11-19 15:06:10 +0000
committerZachary Turner <zturner@google.com>2018-11-19 15:06:10 +0000
commita7dac898036cd598b83f2399f75e4dac3e9c88cd (patch)
treeca382bad9c63eb81c12131106f2f19d89e3b782c
parente228882377dc13a7ca47f3f16d4eb8408df286d9 (diff)
downloadlldb-a7dac898036cd598b83f2399f75e4dac3e9c88cd.tar.gz
Don't use -O in lit tests.
Because of different shell quoting rules, and the fact that LLDB commands often contain spaces, -O is not portable for writing command lines. Instead, we should use explicit lldbinit files. Differential Revision: https://reviews.llvm.org/D54680 git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@347213 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit1
-rw-r--r--lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit1
-rw-r--r--lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit3
-rw-r--r--lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit7
-rw-r--r--lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit4
-rw-r--r--lit/ExecControl/StopHook/stop-hook-threads.test16
-rw-r--r--lit/ExecControl/StopHook/stop-hook.test6
7 files changed, 21 insertions, 17 deletions
diff --git a/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit b/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit
new file mode 100644
index 000000000..4ab5d56f0
--- /dev/null
+++ b/lit/ExecControl/StopHook/Inputs/stop-hook-1.lldbinit
@@ -0,0 +1 @@
+target stop-hook add -n b -o "expr ptr"
diff --git a/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit b/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit
new file mode 100644
index 000000000..906c18b00
--- /dev/null
+++ b/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit
@@ -0,0 +1 @@
+target stop-hook add -f stop-hook.c -l 30 -e 34 -o "expr ptr" \ No newline at end of file
diff --git a/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit b/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit
new file mode 100644
index 000000000..98ed59ca4
--- /dev/null
+++ b/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit
@@ -0,0 +1,3 @@
+target stop-hook add -f stop-hook.c -l 30 -e 34
+expr ptr
+DONE \ No newline at end of file
diff --git a/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit b/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit
new file mode 100644
index 000000000..f192d9952
--- /dev/null
+++ b/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit
@@ -0,0 +1,7 @@
+break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"
+run
+target stop-hook add
+frame variable --show-globals g_val
+thread list
+continue
+DONE
diff --git a/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit b/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit
new file mode 100644
index 000000000..467f60b1e
--- /dev/null
+++ b/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit
@@ -0,0 +1,4 @@
+break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"
+run
+target stop-hook add -x 2 -o "frame variable thread_index"
+target stop-hook add -o continue
diff --git a/lit/ExecControl/StopHook/stop-hook-threads.test b/lit/ExecControl/StopHook/stop-hook-threads.test
index cdda6c082..f2f1267d5 100644
--- a/lit/ExecControl/StopHook/stop-hook-threads.test
+++ b/lit/ExecControl/StopHook/stop-hook-threads.test
@@ -1,19 +1,7 @@
# RUN: %cxx %p/Inputs/stop-hook-threads.cpp -g -o %t
-# RUN: %lldb -b -s %s -O 'target create %t' \
-# RUN: -O 'break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"' \
-# RUN: -O run \
-# RUN: -O 'target stop-hook add' \
-# RUN: -O "frame variable --show-globals g_val" \
-# RUN: -O "thread list" \
-# RUN: -O continue \
-# RUN: -O DONE \
+# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-1.lldbinit -s %s -f %t \
# RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-NO-FILTER %s
-# RUN: %lldb -b -s %s \
-# RUN: -O 'target create %t' \
-# RUN: -O 'break set -f stop-hook-threads.cpp -p "Break here to test that the stop-hook"' \
-# RUN: -O run \
-# RUN: -O 'target stop-hook add -x 2 -o "frame variable thread_index"' \
-# RUN: -O 'target stop-hook add -o continue' \
+# RUN: %lldb -b -s %p/Inputs/stop-hook-threads-2.lldbinit -s %s -f %t \
# RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FILTER %s
thread list
diff --git a/lit/ExecControl/StopHook/stop-hook.test b/lit/ExecControl/StopHook/stop-hook.test
index 8db10f54f..e50b0c636 100644
--- a/lit/ExecControl/StopHook/stop-hook.test
+++ b/lit/ExecControl/StopHook/stop-hook.test
@@ -1,11 +1,11 @@
# RUN: %cc %p/Inputs/stop-hook.c -g -o %t
# Test setting stop-hook per-function
-# RUN: %lldb -b -s %s -O 'target create %t' -O 'target stop-hook add -n b -o "expr ptr"' \
+# RUN: %lldb -b -s %p/Inputs/stop-hook-1.lldbinit -s %s -f %t \
# RUN: | FileCheck --check-prefix=CHECK --check-prefix=CHECK-FUNC %s
# Test setting stop-hook per-line range
-# RUN: %lldb -b -s %s -O 'target create %t' -O 'target stop-hook add -f stop-hook.c -l 30 -e 34 -o "expr ptr"' | FileCheck %s
+# RUN: %lldb -b -s %p/Inputs/stop-hook-2.lldbinit -s %s -f %t | FileCheck %s
# Test setting stop-hook with multi-line expression
-# RUN: %lldb -b -s %s -O 'target create %t' -O 'target stop-hook add -f stop-hook.c -l 30 -e 34' -O 'expr ptr' -O DONE | FileCheck %s
+# RUN: %lldb -b -s %p/Inputs/stop-hook-3.lldbinit -s %s -f %t | FileCheck %s
break set -f stop-hook.c -p "// Set breakpoint here to test target stop-hook"
break set -f stop-hook.c -p "// Another breakpoint which is outside of the stop-hook range"