[Lldb-commits] [lldb] r153239 - in /lldb/trunk/tools/debugserver/source/MacOSX/arm: DNBArchImpl.cpp DNBArchImpl.h
Johnny Chen
johnny.chen at apple.com
Wed Mar 21 22:10:45 PDT 2012
Author: johnny
Date: Thu Mar 22 00:10:43 2012
New Revision: 153239
URL: http://llvm.org/viewvc/llvm-project?rev=153239&view=rev
Log:
Fixed a bug with the r153228 check-in earlier today in that the cached watchpoint
member variables were not reset appropriately.
Modified:
lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp?rev=153239&r1=153238&r2=153239&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp Thu Mar 22 00:10:43 2012
@@ -366,15 +366,18 @@
}
// Disable the triggered watchpoint temporarily because we resume.
- if (this->m_watchpoint_did_occur)
+ if (m_watchpoint_did_occur)
{
- if (this->m_watchpoint_hw_index >= 0) {
- DisableHardwareWatchpoint(this->m_watchpoint_hw_index);
+ if (m_watchpoint_hw_index >= 0) {
+ DisableHardwareWatchpoint(m_watchpoint_hw_index);
DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchMachARM::ThreadWillResume() DisableHardwareWatchpoint(%d) called",
- this->m_watchpoint_hw_index);
+ m_watchpoint_hw_index);
+ // Reset the two watchpoint member variables.
+ m_watchpoint_did_occur = false;
+ m_watchpoint_hw_index = -1;
/*
printf("DNBArchMachARM::ThreadWillResume() DisableHardwareWatchpoint(%d) called",
- this->m_watchpoint_hw_index);
+ m_watchpoint_hw_index);
*/
}
}
@@ -504,19 +507,18 @@
// If yes, retrieve the exc_sub_code as the data break address.
if (!HasWatchpointOccurred())
break;
- //printf("Info -- hardware watchpoint was hit!\n");
- this->m_watchpoint_did_occur = true;
- this->m_watchpoint_hw_index = -1;
+ //printf("Info -- Debug Status and Control Register indicates hardware watchpoint occurred!\n");
// The data break address is passed as exc_data[1].
nub_addr_t addr = exc.exc_data[1];
- //printf("exc.exc_data[1]=0x%x\n", addr);
+ //printf("Info -- from mach exception: exc.exc_data[1]=0x%x\n", addr);
// Find the hardware index with the side effect of possibly massaging the
// addr to return the starting address as seen from the debugger side.
uint32_t hw_index = GetHardwareWatchpointHit(addr);
if (hw_index != INVALID_NUB_HW_INDEX)
{
- this->m_watchpoint_hw_index = hw_index;
+ m_watchpoint_did_occur = true;
+ m_watchpoint_hw_index = hw_index;
//printf("Setting exc.exc_data[1] to %u\n", addr);
exc.exc_data[1] = addr;
// Piggyback the hw_index in the exc.data.
Modified: lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h?rev=153239&r1=153238&r2=153239&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h Thu Mar 22 00:10:43 2012
@@ -261,6 +261,8 @@
arm_decoded_instruction_t m_last_decode_arm;
#endif
nub_addr_t m_last_decode_pc;
+
+ // The following two member variables should be updated atomically.
int32_t m_watchpoint_hw_index;
bool m_watchpoint_did_occur;
More information about the lldb-commits
mailing list