diff options
| author | Jim Ingham <jingham@apple.com> | 2014-01-15 03:32:42 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2014-01-15 03:32:42 +0000 |
| commit | 39fdae7f6a59a63e64977fe42350141928e8ac6b (patch) | |
| tree | 8224883bc323c02d2217828e86fae639ef6fe6f4 /lldb/source/Target | |
| parent | a8b99ca4bb299bd0191983dfd36e6349fdec5fb3 (diff) | |
| download | bcm5719-llvm-39fdae7f6a59a63e64977fe42350141928e8ac6b.tar.gz bcm5719-llvm-39fdae7f6a59a63e64977fe42350141928e8ac6b.zip | |
Fix a bug where if we stop but nobody says there was a reason for the stop, we would return
control to the user anyway. This was put in to handle monitors that would say there was no
stop reason when you first attached to them. But it broke the case where you hit a thread specific
breakpoint on many threads, but NOT the one specified in the breakpoint. I work around this
by only doing the junky override when the StopID is 0 - i.e. on first attach.
This commit also adds a test for thread specific breakpoints.
llvm-svn: 199290
Diffstat (limited to 'lldb/source/Target')
| -rw-r--r-- | lldb/source/Target/ThreadList.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index 1f8b351100a..c73b01f520a 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -293,17 +293,31 @@ ThreadList::ShouldStop (Event *event_ptr) { ThreadSP thread_sp(*pos); - did_anybody_stop_for_a_reason |= thread_sp->ThreadStoppedForAReason(); + // We should never get a stop for which no thread had a stop reason, but sometimes we do see this - + // for instance when we first connect to a remote stub. In that case we should stop, since we can't figure out + // the right thing to do and stopping gives the user control over what to do in this instance. + // + // Note, this causes a problem when you have a thread specific breakpoint, and a bunch of threads hit the breakpoint, + // but not the thread which we are waiting for. All the threads that are not "supposed" to hit the breakpoint + // are marked as having no stop reason, which is right, they should not show a stop reason. But that triggers this + // code and causes us to stop seemingly for no reason. + // + // Since the only way we ever saw this error was on first attach, I'm only going to trigger set did_anybody_stop_for_a_reason + // to true unless this is the first stop. + // + // If this becomes a problem, we'll have to have another StopReason like "StopInfoHidden" which will look invalid + // everywhere but at this check. + + if (thread_sp->GetProcess()->GetStopID() != 0) + did_anybody_stop_for_a_reason = true; + else + did_anybody_stop_for_a_reason |= thread_sp->ThreadStoppedForAReason(); const bool thread_should_stop = thread_sp->ShouldStop(event_ptr); if (thread_should_stop) should_stop |= true; } - // We should never get a stop for which no thread had a stop reason, but sometimes we do see this - - // for instance when we first connect to a remote stub. In that case we should stop, since we can't figure out - // the right thing to do and stopping gives the user control over what to do in this instance. - if (!should_stop && !did_anybody_stop_for_a_reason) { should_stop = true; |

