Author: Jonas Devlieghere Date: 2022-02-07T12:08:24-08:00 New Revision: a5a71b139c6b3cb2cc569c81f91210dede2f1f4c
URL: https://github.com/llvm/llvm-project/commit/a5a71b139c6b3cb2cc569c81f91210dede2f1f4c DIFF: https://github.com/llvm/llvm-project/commit/a5a71b139c6b3cb2cc569c81f91210dede2f1f4c.diff LOG: [lldb] Fix Lua/watchpoint_callback.test on Apple Silicon As Pavel pointed out, on Apple Silicon "b main" stops at a point after the variable has already been initialized. This patch updates the test case to avoids that. I've also split the test into separate files so its easier to reproduce the individual scenarios without having to build any shared state. Added: lldb/test/Shell/ScriptInterpreter/Lua/Inputs/val.c lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint1.in lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint2.in lldb/test/Shell/ScriptInterpreter/Lua/Inputs/watchpoint3.in Modified: lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test Removed: ################################################################################ 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 0000000000000..5c70375c9d0fa --- /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 0000000000000..b6734dde63a85 --- /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 0000000000000..94af2d1340b00 --- /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 0000000000000..f780e0af9c739 --- /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 3a559f8d68d14..11bbe03410774 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 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits