Implement x86_64 debug register read/write in support of hardware watchpoints. Hoist LinuxThread::TraceNotify code back into POSIXThread::TraceNotify()
llvm.org/pr16706
Differential D2572
FreeBSD watchpoint support jwolfe on Jan 17 2014, 3:40 PM. Authored by
Details
Implement x86_64 debug register read/write in support of hardware watchpoints. Hoist LinuxThread::TraceNotify code back into POSIXThread::TraceNotify() llvm.org/pr16706
Diff Detail Event Timeline
Comment Actions Responded inline to Ed Maste's comments.
Comment Actions Updated the patch to properly report watchpoints hit in threads created after the watchpoint was initially set. POSIXBreakpointProtocol::ForceWatchpointsInitialized() member function added.
Comment Actions Updated the patch to resolve trailing whitespace warnings and eliminate the "#ifndef NDEBUG" in the POSIXThread constructor.
Comment Actions The EnableHardwareWatchpoint() call in POSIXThread() is not needed. In existing code, the function call is within an assert(); ergo not in a production lldb. Revised the comment before the ForceWatchpointsInitialized() call. Corrected a typo in RegisterContextPOSIX.h
Comment Actions Good catch Ed. I have remove the <machine/reg.h> include and added a suitable copy of the "struct dbreg" from http://svnweb.freebsd.org/base/head/sys/x86/include/reg.h in source/Plugins/Process/POSIX/RegisterContextFreeBSD_x86_64.cpp Comment Actions Hey guys, I gave this a run on Ubuntu 12.04 x86_64 using gcc 4.8.2 and a recent libedit (much newer than libedit-dev on 12.04, it's the July 2013 3.x version of libedit). The test runs came back with no additional test failures. It looks fine on the Linux side. Thanks for pinging me on it, Ed. Sincerely, Comment Actions Is this patch to enable watchpoints in FreeBSD ready to be checked-in? Todd Fiala has responded that the changes do not present a problem for Ubuntu Linux. |
I don't follow the FIXME comment - it is using the tid, no?