diff options
author | Jim Ingham <jingham@apple.com> | 2019-03-01 18:13:38 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2019-03-01 18:13:38 +0000 |
commit | 3139fc976795c1cb29c46b4c5cb7c571e619a73c (patch) | |
tree | cef747669300658cba860bea52640587bb13c455 /lldb/lit/ExecControl/StopHook/Inputs | |
parent | 21f7c35df1de6c2b16aa663e26cb4d09099118a2 (diff) | |
download | bcm5719-llvm-3139fc976795c1cb29c46b4c5cb7c571e619a73c.tar.gz bcm5719-llvm-3139fc976795c1cb29c46b4c5cb7c571e619a73c.zip |
Resubmit r354706 with a fix for process launch.
When the debugger is run in sync mode, you need to
be able to tell whether a hijacked resume is for some
special purpose (like waiting for the SIGSTOP on attach)
or just to perform a synchronous resume. Target::Launch was doing
that wrong, and that caused stop-hooks on process launch
in source files to behave incorrectly.
<rdar://problem/48115661>
Differential Revision: https://reviews.llvm.org/D58727
llvm-svn: 355213
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; } |