summaryrefslogtreecommitdiffstats
path: root/source/Plugins/Process/POSIX/POSIXThread.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2014-02-25 21:42:16 +0000
committeremaste <emaste@FreeBSD.org>2014-02-25 21:42:16 +0000
commit788502c6f6261e2d84ef85d1052b41a6c5be31b3 (patch)
treee0f754ea0922908b0f1be8f01c4efbdfc20462eb /source/Plugins/Process/POSIX/POSIXThread.cpp
parent6beac4fcf9e5327f07c0fefd527180124438096a (diff)
downloadFreeBSD-src-788502c6f6261e2d84ef85d1052b41a6c5be31b3.zip
FreeBSD-src-788502c6f6261e2d84ef85d1052b41a6c5be31b3.tar.gz
Import LLDB as of SVN r202189 (git 32871eb)
(A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Plugins/Process/POSIX/POSIXThread.cpp')
-rw-r--r--source/Plugins/Process/POSIX/POSIXThread.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/Plugins/Process/POSIX/POSIXThread.cpp b/source/Plugins/Process/POSIX/POSIXThread.cpp
index 8d4c71f..cc759ea 100644
--- a/source/Plugins/Process/POSIX/POSIXThread.cpp
+++ b/source/Plugins/Process/POSIX/POSIXThread.cpp
@@ -65,7 +65,16 @@ POSIXThread::POSIXThread(Process &process, lldb::tid_t tid)
lldb::WatchpointSP wp = wp_list.GetByIndex(wp_idx);
if (wp.get() && wp->IsEnabled())
{
- assert(EnableHardwareWatchpoint(wp.get()));
+ // This watchpoint as been enabled; obviously this "new" thread
+ // has been created since that watchpoint was enabled. Since
+ // the POSIXBreakpointProtocol has yet to be initialized, its
+ // m_watchpoints_initialized member will be FALSE. Attempting to
+ // read the debug status register to determine if a watchpoint
+ // has been hit would result in the zeroing of that register.
+ // Since the active debug registers would have been cloned when
+ // this thread was created, simply force the m_watchpoints_initized
+ // member to TRUE and avoid resetting dr6 and dr7.
+ GetPOSIXBreakpointProtocol()->ForceWatchpointsInitialized();
}
}
}
@@ -509,6 +518,21 @@ POSIXThread::WatchNotify(const ProcessMessage &message)
void
POSIXThread::TraceNotify(const ProcessMessage &message)
{
+ POSIXBreakpointProtocol* reg_ctx = GetPOSIXBreakpointProtocol();
+ if (reg_ctx)
+ {
+ uint32_t num_hw_wps = reg_ctx->NumSupportedHardwareWatchpoints();
+ uint32_t wp_idx;
+ for (wp_idx = 0; wp_idx < num_hw_wps; wp_idx++)
+ {
+ if (reg_ctx->IsWatchpointHit(wp_idx))
+ {
+ WatchNotify(message);
+ return;
+ }
+ }
+ }
+
SetStopInfo (StopInfo::CreateStopReasonToTrace(*this));
}
OpenPOWER on IntegriCloud