diff options
| author | Julian Lettner <yln@users.noreply.github.com> | 2025-04-01 15:36:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-01 15:36:35 -0700 |
| commit | c8764f0c655b2edb139896ecbb9f5bfd932fbe4b (patch) | |
| tree | a456db5c6df8c2dbe0a804b13c27abab983ec9a6 /lldb/source/Target/Target.cpp | |
| parent | 7b2b3faeb1d82148872720e254cc34b3e6d48b31 (diff) | |
Fix handling of auto_continue for stop hooks (#129622)
Follow-up fix discussed here:
https://github.com/llvm/llvm-project/pull/129578#issuecomment-2695838042
---------
Co-authored-by: Jim Ingham <jingham@apple.com>
Diffstat (limited to 'lldb/source/Target/Target.cpp')
| -rw-r--r-- | lldb/source/Target/Target.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 09c0c0b8a5db..42b1561fb299 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -3094,7 +3094,6 @@ bool Target::RunStopHooks() { bool print_hook_header = (m_stop_hooks.size() != 1); bool print_thread_header = (num_exe_ctx != 1); - bool auto_continue = false; bool should_stop = false; bool requested_continue = false; @@ -3108,10 +3107,6 @@ bool Target::RunStopHooks() { if (!cur_hook_sp->ExecutionContextPasses(exc_ctx)) continue; - // We only consult the auto-continue for a stop hook if it matched the - // specifier. - auto_continue |= cur_hook_sp->GetAutoContinue(); - if (print_hook_header && !any_thread_matched) { StreamString s; cur_hook_sp->GetDescription(s, eDescriptionLevelBrief); @@ -3130,7 +3125,10 @@ bool Target::RunStopHooks() { auto result = cur_hook_sp->HandleStop(exc_ctx, output_sp); switch (result) { case StopHook::StopHookResult::KeepStopped: - should_stop = true; + if (cur_hook_sp->GetAutoContinue()) + requested_continue = true; + else + should_stop = true; break; case StopHook::StopHookResult::RequestContinue: requested_continue = true; @@ -3155,10 +3153,9 @@ bool Target::RunStopHooks() { } } - // Resume iff: - // 1) At least one hook requested to continue and no hook asked to stop, or - // 2) at least one hook had auto continue on. - if ((requested_continue && !should_stop) || auto_continue) { + // Resume iff at least one hook requested to continue and no hook asked to + // stop. + if (requested_continue && !should_stop) { Log *log = GetLog(LLDBLog::Process); Status error = m_process_sp->PrivateResume(); if (error.Success()) { |
