summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-09-17 01:05:03 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-09-17 01:05:03 +0000
commit236888d0264685aa59f28c9e22a601ed98ece77e (patch)
treee90c20b18d1fb12230fb1ce8895ee848b3641dbd /lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
parent2fd3d401f9fd1fd8779374a8de31532ad5dba0fc (diff)
downloadbcm5719-llvm-236888d0264685aa59f28c9e22a601ed98ece77e.tar.gz
bcm5719-llvm-236888d0264685aa59f28c9e22a601ed98ece77e.zip
Foe x86_64/i386, piggyback the hardware index of the fired watchpoint in the exception
data sent back to the debugger. On the debugger side, use the opportunity during the StopInfoMachException::CreateStopReasonWithMachException() method to set the hardware index for the very watchpoint location. llvm-svn: 139975
Diffstat (limited to 'lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp')
-rw-r--r--lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
index 71ec18fa97f..b62c0c340b2 100644
--- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -245,7 +245,8 @@ StopInfoMachException::CreateStopReasonWithMachException
uint32_t exc_type,
uint32_t exc_data_count,
uint64_t exc_code,
- uint64_t exc_sub_code
+ uint64_t exc_sub_code,
+ uint64_t exc_sub_sub_code
)
{
if (exc_type != 0)
@@ -303,10 +304,17 @@ StopInfoMachException::CreateStopReasonWithMachException
return StopInfo::CreateStopReasonToTrace(thread);
// It's a watchpoint, then.
+ // The exc_sub_code indicates the data break address.
lldb::WatchpointLocationSP wp_loc_sp =
thread.GetProcess().GetTarget().GetWatchpointLocationList().FindByAddress((lldb::addr_t)exc_sub_code);
if (wp_loc_sp)
+ {
+ // 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_loc_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_loc_sp->GetID());
+ }
}
else if (exc_code == 2) // EXC_I386_BPT
{
OpenPOWER on IntegriCloud