diff options
| author | Jim Ingham <jingham@apple.com> | 2011-01-22 01:30:53 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2011-01-22 01:30:53 +0000 |
| commit | e22e88b8a88461adfa2ee84f4c57b6a0ad9bc943 (patch) | |
| tree | b8f4c2badabd14eaa88940c4ea49c9cd871d29ec | |
| parent | e54defe4a3da60de0f43aad6ad3b14be32d9e8b1 (diff) | |
| download | bcm5719-llvm-e22e88b8a88461adfa2ee84f4c57b6a0ad9bc943.tar.gz bcm5719-llvm-e22e88b8a88461adfa2ee84f4c57b6a0ad9bc943.zip | |
Add more logging. Try to handle the case where "Halt" fails. This is kind of a losing game in the end, if we can't halt the target, it is not clear what we can do but keep trying...
llvm-svn: 124017
| -rw-r--r-- | lldb/source/Target/Process.cpp | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 32769c27fe2..2903daddde9 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -2651,7 +2651,9 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, single_thread_timeout_usec); } - if (exe_ctx.process->Halt().Success()) + Error halt_error = exe_ctx.process->Halt(); + + if (halt_error.Success()) { timeout_ptr = NULL; if (log) @@ -2698,6 +2700,22 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, } } } + else + { + + if (log) + log->Printf ("Halt failed: \"%s\", I'm just going to wait a little longer and see if the world gets nicer to me.", + halt_error.AsCString()); + + if (single_thread_timeout_usec != 0) + { + real_timeout = TimeValue::Now(); + real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec); + timeout_ptr = &real_timeout; + } + continue; + } + } stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get()); @@ -2722,7 +2740,13 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, if (log) { StreamString s; - event_sp->Dump (&s); + if (event_sp) + event_sp->Dump (&s); + else + { + log->Printf ("Stop event that interrupted us is NULL."); + } + StreamString ts; const char *event_explanation; @@ -2764,7 +2788,7 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, continue; } - ts.Printf("<"); + ts.Printf("<0x%4.4x ", thread->GetID()); RegisterContext *register_context = thread->GetRegisterContext().get(); if (register_context) @@ -2785,8 +2809,26 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, event_explanation = ts.GetData(); } while (0); - if (log) - log->Printf("Execution interrupted: %s %s", s.GetData(), event_explanation); + // See if any of the threads that stopped think we ought to stop. Otherwise continue on. + if (!GetThreadList().ShouldStop(event_sp.get())) + { + if (log) + log->Printf("Execution interrupted, but nobody wanted to stop, so we continued: %s %s", + s.GetData(), event_explanation); + if (single_thread_timeout_usec != 0) + { + real_timeout = TimeValue::Now(); + real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec); + timeout_ptr = &real_timeout; + } + + continue; + } + else + { + if (log) + log->Printf("Execution interrupted: %s %s", s.GetData(), event_explanation); + } } if (discard_on_error && thread_plan_sp) |

