aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorOmair Javaid <omair.javaid@linaro.org>2017-02-24 13:27:31 +0000
committerOmair Javaid <omair.javaid@linaro.org>2017-02-24 13:27:31 +0000
commitd5ffbad275c8800fcd4e0c1d5efe813352d5977e (patch)
treebd9128ea1c1057a32bfd04c9e480c2597ebed628 /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parentd224c08efcccd1f9db912c30774ffbab5c3be063 (diff)
downloadllvm-d5ffbad275c8800fcd4e0c1d5efe813352d5977e.tar.gz
llvm-d5ffbad275c8800fcd4e0c1d5efe813352d5977e.tar.bz2
llvm-d5ffbad275c8800fcd4e0c1d5efe813352d5977e.zip
Hardware breakpoints for Linux on Arm/AArch64 targets
Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 1ff8893192f0..05276294f0e6 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -870,6 +870,19 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
break;
}
+ // If a breakpoint was hit, report it
+ uint32_t bp_index;
+ error = thread.GetRegisterContext()->GetHardwareBreakHitIndex(
+ bp_index, (uintptr_t)info.si_addr);
+ if (error.Fail())
+ LLDB_LOG(log, "received error while checking for hardware "
+ "breakpoint hits, pid = {0}, error = {1}",
+ thread.GetID(), error);
+ if (bp_index != LLDB_INVALID_INDEX32) {
+ MonitorBreakpoint(thread);
+ break;
+ }
+
// Otherwise, report step over
MonitorTrace(thread);
break;
@@ -1726,11 +1739,18 @@ Error NativeProcessLinux::GetSoftwareBreakpointPCOffset(
Error NativeProcessLinux::SetBreakpoint(lldb::addr_t addr, uint32_t size,
bool hardware) {
if (hardware)
- return Error("NativeProcessLinux does not support hardware breakpoints");
+ return SetHardwareBreakpoint(addr, size);
else
return SetSoftwareBreakpoint(addr, size);
}
+Error NativeProcessLinux::RemoveBreakpoint(lldb::addr_t addr, bool hardware) {
+ if (hardware)
+ return RemoveHardwareBreakpoint(addr);
+ else
+ return NativeProcessProtocol::RemoveBreakpoint(addr);
+}
+
Error NativeProcessLinux::GetSoftwareBreakpointTrapOpcode(
size_t trap_opcode_size_hint, size_t &actual_opcode_size,
const uint8_t *&trap_opcode_bytes) {