diff options
Diffstat (limited to 'lldb/lit/ExecControl/StopHook/Inputs')
5 files changed, 13 insertions, 8 deletions
diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit index 13de5fb60bc..31817bdaaa5 100644 --- a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit +++ b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-2.lldbinit @@ -1 +1 @@ -target stop-hook add -f stop-hook.c -l 29 -e 34 -o "expr ptr"
\ No newline at end of file +target stop-hook add -f stop-hook.c -l 29 -e 34 -o "expr ptr" diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit index b4dcda2f88f..36e144deecc 100644 --- a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit +++ b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-3.lldbinit @@ -1,3 +1,3 @@ target stop-hook add -f stop-hook.c -l 29 -e 34 expr ptr -DONE
\ No newline at end of file +DONE diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit index f192d9952e9..004bd34abfb 100644 --- a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit +++ b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-1.lldbinit @@ -1,7 +1,7 @@ +break set -f stop-hook-threads.cpp -p "Break here to set up the stop hook" 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 +target stop-hook add -G true +expr lldb_val += 1 thread list -continue DONE diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit index 467f60b1e1e..3b7d23953c3 100644 --- a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit +++ b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads-2.lldbinit @@ -1,4 +1,5 @@ +break set -f stop-hook-threads.cpp -p "Break here to set up the stop hook" 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 +target stop-hook add -x 2 -o "expr lldb_val += 1" -o "thread list" +target stop-hook add -G true -o "script print('Hit stop hook') diff --git a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp index 5b6f31edd1b..e653f5ff518 100644 --- a/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp +++ b/lldb/lit/ExecControl/StopHook/Inputs/stop-hook-threads.cpp @@ -16,6 +16,7 @@ std::default_random_engine g_random_engine{std::random_device{}()}; std::uniform_int_distribution<> g_distribution{0, 3000}; uint32_t g_val = 0; +uint32_t lldb_val = 0; uint32_t access_pool (bool flag = false) @@ -62,7 +63,8 @@ thread_func (uint32_t thread_index) int main (int argc, char const *argv[]) { std::thread threads[3]; - + // Break here to set up the stop hook + printf("Stop hooks engaged.\n"); // Create 3 threads for (auto &thread : threads) thread = std::thread{thread_func, std::distance(threads, &thread)}; @@ -71,5 +73,7 @@ int main (int argc, char const *argv[]) for (auto &thread : threads) thread.join(); + // print lldb_val so we can check it here. + printf ("lldb_val was set to: %d.\n", lldb_val); return 0; } |

