diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/val.c b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/val.c new file mode 100644 index 000000000000..5c70375c9d0f --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/val.c @@ -0,0 +1,7 @@ +int main() { + int val = 0; + // Break here + val++; + val++; + return 0; +} diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint1.in b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint1.in new file mode 100644 index 000000000000..b6734dde63a8 --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint1.in @@ -0,0 +1,9 @@ +breakpoint set -p "Break here" +r +watchpoint set variable val +watchpoint command add -s lua +print("val=" .. tostring(frame:FindVariable("val"):GetValue())) +quit +c +# CHECK: val=1 +# CHECK: val=2 diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint2.in b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint2.in new file mode 100644 index 000000000000..94af2d1340b0 --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint2.in @@ -0,0 +1,11 @@ +breakpoint set -p "Break here" +r +watchpoint set variable val +watchpoint modify 1 -c "(val == 1)" +watchpoint command add -s lua +print("conditional watchpoint") +wp:SetEnabled(false) +quit +c +# CHECK-COUNT-1: conditional watchpoint +# CHECK-NOT: conditional watchpoint diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint3.in b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint3.in new file mode 100644 index 000000000000..f780e0af9c73 --- /dev/null +++ b/lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint3.in @@ -0,0 +1,8 @@ +breakpoint set -p "Break here" +r +watchpoint set expr 0x00 +watchpoint command add -s lua +print("never triggers") +quit +c +# CHECK-NOT: never triggers diff --git a/lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test b/lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test index 3a559f8d68d1..11bbe0341077 100644 --- a/lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test +++ b/lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test @@ -1,32 +1,5 @@ # XFAIL: system-netbsd -# RUN: echo "int main() { int val = 1; val++; return 0; }" | %clang_host -x c - -g -o %t -# RUN: %lldb -s %s --script-language lua %t 2>&1 | FileCheck %s -b main -r -watchpoint set variable val -watchpoint command add -s lua -print("val=" .. tostring(frame:FindVariable("val"):GetValue())) -quit -c -# CHECK: val=1 -# CHECK: val=2 -# CHECK: Process {{[0-9]+}} exited -r -watchpoint set variable val -watchpoint modify 1 -c "(val == 1)" -watchpoint command add -s lua -print("conditional watchpoint") -wp:SetEnabled(false) -quit -c -# CHECK-COUNT-1: conditional watchpoint -# CHECK-NOT: conditional watchpoint -# CHECK: Process {{[0-9]+}} exited -r -watchpoint set expr 0x00 -watchpoint command add -s lua -print("never triggers") -quit -c -# CHECK-NOT: never triggers -# CHECK: Process {{[0-9]+}} exited +# RUN: %clang_host -x c %S/Inputs/val.c -g -o %t +# RUN: %lldb -b -s %S/Inputs/watchpoint1.in --script-language lua %t 2>&1 | FileCheck %S/Inputs/watchpoint1.in +# RUN: %lldb -b -s %S/Inputs/watchpoint2.in --script-language lua %t 2>&1 | FileCheck %S/Inputs/watchpoint2.in +# RUN: %lldb -b -s %S/Inputs/watchpoint3.in --script-language lua %t 2>&1 | FileCheck %S/Inputs/watchpoint3.in