[Lldb-commits] [lldb] r244742 - Fix read only watchpoints on x86_64

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 12 05:22:42 PDT 2015


Author: tberghammer
Date: Wed Aug 12 07:22:42 2015
New Revision: 244742

URL: http://llvm.org/viewvc/llvm-project?rev=244742&view=rev
Log:
Fix read only watchpoints on x86_64

On x86/x86_64 read only watchpoints aren't supported. Fall back
to read/write watchpoints in that case.

Note: Logic should be added to ignore the watchpoint hit when
occurred because of a write.

Modified:
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp?rev=244742&r1=244741&r2=244742&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp Wed Aug 12 07:22:42 2015
@@ -1018,8 +1018,10 @@ NativeRegisterContextLinux_x86_64::SetHa
     if (wp_index >= NumSupportedHardwareWatchpoints())
         return Error ("Watchpoint index out of range");
 
+    // Read only watchpoints aren't supported on x86_64. Fall back to read/write waitchpoints instead.
+    // TODO: Add logic to detect when a write happens and ignore that watchpoint hit.
     if (watch_flags == 0x2)
-        return Error ("Read watchpoints currently unsupported on x86_64 architecture");
+        watch_flags = 0x3;
 
     if (watch_flags != 0x1 && watch_flags != 0x3)
         return Error ("Invalid read/write bits for watchpoint");




More information about the lldb-commits mailing list