summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-10-11 19:48:25 +0000
committerGreg Clayton <gclayton@apple.com>2013-10-11 19:48:25 +0000
commiteb023e75dc9d0bbc0d88ba1379e449570b8678fa (patch)
tree08065fe5bdc77f6e8a657a579c3481c428d0393f /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent877615ccfdaadc154420dcc5a2939c56bf5fa4aa (diff)
downloadbcm5719-llvm-eb023e75dc9d0bbc0d88ba1379e449570b8678fa.tar.gz
bcm5719-llvm-eb023e75dc9d0bbc0d88ba1379e449570b8678fa.zip
<rdar://problem/13635174>
Added a way to set hardware breakpoints from the "breakpoint set" command with the new "--hardware" option. Hardware breakpoints are not a request, they currently are a requirement. So when breakpoints are specified as hardware breakpoints, they might fail to be set when they are able to be resolved and should be used sparingly. This is currently hooked up for GDB remote debugging. Linux and FreeBSD should quickly enable this feature if possible, or return an error for any breakpoints that are hardware breakpoint sites in the "virtual Error Process::EnableBreakpointSite (BreakpointSite *bp_site);" function. llvm-svn: 192491
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 4a3bd041524..31b430c3e82 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2223,7 +2223,7 @@ ProcessGDBRemote::EnableBreakpointSite (BreakpointSite *bp_site)
{
const size_t bp_op_size = GetSoftwareBreakpointTrapOpcode (bp_site);
- if (bp_site->HardwarePreferred())
+ if (bp_site->HardwareRequired())
{
// Try and set hardware breakpoint, and if that fails, fall through
// and set a software breakpoint?
@@ -2233,12 +2233,19 @@ ProcessGDBRemote::EnableBreakpointSite (BreakpointSite *bp_site)
{
bp_site->SetEnabled(true);
bp_site->SetType (BreakpointSite::eHardware);
- return error;
}
+ else
+ {
+ error.SetErrorString("failed to set hardware breakpoint (hardware breakpoint resources might be exhausted or unavailable)");
+ }
+ }
+ else
+ {
+ error.SetErrorString("hardware breakpoints are not supported");
}
+ return error;
}
-
- if (m_gdb_comm.SupportsGDBStoppointPacket (eBreakpointSoftware))
+ else if (m_gdb_comm.SupportsGDBStoppointPacket (eBreakpointSoftware))
{
if (m_gdb_comm.SendGDBStoppointTypePacket(eBreakpointSoftware, true, addr, bp_op_size) == 0)
{
OpenPOWER on IntegriCloud