Add missing watchpoint stop info creation logic for arm on the debugger side.

WIP for rdar://problem/9667960

llvm-svn: 153206
This commit is contained in:
Johnny Chen 2012-03-21 18:28:25 +00:00
parent 02fc6e86a6
commit 72ee62e030
1 changed files with 14 additions and 1 deletions

View File

@ -314,7 +314,7 @@ StopInfoMachException::CreateStopReasonWithMachException
lldb::WatchpointSP wp_sp;
if (target)
wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
if (wp_sp)
if (wp_sp && wp_sp->IsEnabled())
{
// Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
// Set the hardware index if that's the case.
@ -337,6 +337,19 @@ StopInfoMachException::CreateStopReasonWithMachException
case llvm::Triple::arm:
if (exc_code == 0x102)
{
// It's a watchpoint, then, if the exc_sub_code indicates a known/enabled
// data break address from our watchpoint list.
lldb::WatchpointSP wp_sp;
if (target)
wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
if (wp_sp && wp_sp->IsEnabled())
{
// Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
// Set the hardware index if that's the case.
if (exc_data_count >=3)
wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_sp->GetID());
}
// EXC_ARM_DA_DEBUG seems to be reused for EXC_BREAKPOINT as well as EXC_BAD_ACCESS
return StopInfo::CreateStopReasonToTrace(thread);
}