[Lldb-commits] [lldb] r244741 - Fix LLGS to enable read type watchpoints
Omair Javaid via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 12 04:30:21 PDT 2015
Author: omjavaid
Date: Wed Aug 12 06:30:21 2015
New Revision: 244741
URL: http://llvm.org/viewvc/llvm-project?rev=244741&view=rev
Log:
Fix LLGS to enable read type watchpoints
http://reviews.llvm.org/D11902
Modified:
lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.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=244741&r1=244740&r2=244741&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 06:30:21 2015
@@ -1018,6 +1018,9 @@ NativeRegisterContextLinux_x86_64::SetHa
if (wp_index >= NumSupportedHardwareWatchpoints())
return Error ("Watchpoint index out of range");
+ if (watch_flags == 0x2)
+ return Error ("Read watchpoints currently unsupported on x86_64 architecture");
+
if (watch_flags != 0x1 && watch_flags != 0x3)
return Error ("Invalid read/write bits for watchpoint");
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=244741&r1=244740&r2=244741&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Wed Aug 12 06:30:21 2015
@@ -2227,6 +2227,7 @@ GDBRemoteCommunicationServerLLGS::Handle
bool want_breakpoint = true;
bool want_hardware = false;
+ uint32_t watch_flags = 0;
const GDBStoppointType stoppoint_type =
GDBStoppointType(packet.GetS32 (eStoppointInvalid));
@@ -2237,10 +2238,13 @@ GDBRemoteCommunicationServerLLGS::Handle
case eBreakpointHardware:
want_hardware = true; want_breakpoint = true; break;
case eWatchpointWrite:
+ watch_flags = 1;
want_hardware = true; want_breakpoint = false; break;
case eWatchpointRead:
+ watch_flags = 2;
want_hardware = true; want_breakpoint = false; break;
case eWatchpointReadWrite:
+ watch_flags = 3;
want_hardware = true; want_breakpoint = false; break;
case eStoppointInvalid:
return SendIllFormedResponse(packet, "Z packet had invalid software/hardware specifier");
@@ -2280,11 +2284,6 @@ GDBRemoteCommunicationServerLLGS::Handle
}
else
{
- uint32_t watch_flags =
- stoppoint_type == eWatchpointWrite
- ? 0x1 // Write
- : 0x3; // ReadWrite
-
// Try to set the watchpoint.
const Error error = m_debugged_process_sp->SetWatchpoint (
addr, size, watch_flags, want_hardware);
More information about the lldb-commits
mailing list