diff options
| author | Jim Ingham <jingham@apple.com> | 2012-07-11 21:41:19 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2012-07-11 21:41:19 +0000 |
| commit | 54cc6e407a478d2ddf3535ea752a463442fcc367 (patch) | |
| tree | 3f1ad6974bbe521229bf775933eb4b6aa1c28759 /lldb/source | |
| parent | 63614c925fcb6023c9bebd175a61baaaadd422db (diff) | |
| download | bcm5719-llvm-54cc6e407a478d2ddf3535ea752a463442fcc367.tar.gz bcm5719-llvm-54cc6e407a478d2ddf3535ea752a463442fcc367.zip | |
If we hit a breakpoint but there's a thread specifier which doesn't match this thread, return no stop reason.
llvm-svn: 160080
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 7479d1e7d4c..e0d22360156 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -1423,17 +1423,18 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, // we can just report no reason. We don't need to worry about stepping over the breakpoint here, that // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc. + handled = true; if (bp_site_sp->ValidForThisThread (gdb_thread)) { gdb_thread->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID())); - handled = true; + } + else + { + StopInfoSP invalid_stop_info_sp; + gdb_thread->SetStopInfo (invalid_stop_info_sp); } } - if (!handled) - { - gdb_thread->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp)); - } } else if (reason.compare("trap") == 0) { @@ -1459,8 +1460,10 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) { // Currently we are going to assume SIGTRAP means we are either // hitting a breakpoint or hardware single stepping. + handled = true; addr_t pc = gdb_thread->GetRegisterContext()->GetPC(); lldb::BreakpointSiteSP bp_site_sp = gdb_thread->GetProcess()->GetBreakpointSiteList().FindByAddress(pc); + if (bp_site_sp) { // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread, @@ -1469,15 +1472,18 @@ ProcessGDBRemote::SetThreadStopInfo (StringExtractor& stop_packet) if (bp_site_sp->ValidForThisThread (gdb_thread)) { gdb_thread->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID())); - handled = true; + } + else + { + StopInfoSP invalid_stop_info_sp; + gdb_thread->SetStopInfo (invalid_stop_info_sp); } } - if (!handled) + else { // TODO: check for breakpoint or trap opcode in case there is a hard // coded software trap gdb_thread->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp)); - handled = true; } } if (!handled) |

