summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmair Javaid <omair.javaid@linaro.org>2015-08-12 11:30:21 +0000
committerOmair Javaid <omair.javaid@linaro.org>2015-08-12 11:30:21 +0000
commitcf8eb9da4d0e4a7d66e79c1ea6de623d82666496 (patch)
tree62e64abda315f6a6aaa30c01e8abd1458e79512f
parentfe0d9bb6ebe5334c4efc31a48979c5f39597f323 (diff)
downloadbcm5719-llvm-cf8eb9da4d0e4a7d66e79c1ea6de623d82666496.tar.gz
bcm5719-llvm-cf8eb9da4d0e4a7d66e79c1ea6de623d82666496.zip
Fix LLGS to enable read type watchpoints
http://reviews.llvm.org/D11902 llvm-svn: 244741
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp3
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp9
2 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index a7390f58713..2ce822043af 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -1018,6 +1018,9 @@ NativeRegisterContextLinux_x86_64::SetHardwareWatchpointWithIndex(
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");
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 3a7ad346b08..1ce9ba64c19 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -2227,6 +2227,7 @@ GDBRemoteCommunicationServerLLGS::Handle_Z (StringExtractorGDBRemote &packet)
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_Z (StringExtractorGDBRemote &packet)
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_Z (StringExtractorGDBRemote &packet)
}
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);
OpenPOWER on IntegriCloud