summaryrefslogtreecommitdiffstats
path: root/lldb/source/Breakpoint
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/Breakpoint
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/Breakpoint')
-rw-r--r--lldb/source/Breakpoint/Breakpoint.cpp3
-rw-r--r--lldb/source/Breakpoint/BreakpointLocation.cpp2
-rw-r--r--lldb/source/Breakpoint/BreakpointLocationList.cpp2
-rw-r--r--lldb/source/Breakpoint/StoppointLocation.cpp8
4 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Breakpoint/Breakpoint.cpp b/lldb/source/Breakpoint/Breakpoint.cpp
index 9bc43814b48..56a70666615 100644
--- a/lldb/source/Breakpoint/Breakpoint.cpp
+++ b/lldb/source/Breakpoint/Breakpoint.cpp
@@ -45,8 +45,9 @@ Breakpoint::GetEventIdentifier ()
//----------------------------------------------------------------------
// Breakpoint constructor
//----------------------------------------------------------------------
-Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, BreakpointResolverSP &resolver_sp) :
+Breakpoint::Breakpoint(Target &target, SearchFilterSP &filter_sp, BreakpointResolverSP &resolver_sp, bool hardware) :
m_being_created(true),
+ m_hardware(hardware),
m_target (target),
m_filter_sp (filter_sp),
m_resolver_sp (resolver_sp),
diff --git a/lldb/source/Breakpoint/BreakpointLocation.cpp b/lldb/source/Breakpoint/BreakpointLocation.cpp
index 1ec726dd52b..bd165facd28 100644
--- a/lldb/source/Breakpoint/BreakpointLocation.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocation.cpp
@@ -484,7 +484,7 @@ BreakpointLocation::ResolveBreakpointSite ()
if (process == NULL)
return false;
- lldb::break_id_t new_id = process->CreateBreakpointSite (shared_from_this(), false);
+ lldb::break_id_t new_id = process->CreateBreakpointSite (shared_from_this(), m_owner.IsHardware());
if (new_id == LLDB_INVALID_BREAK_ID)
{
diff --git a/lldb/source/Breakpoint/BreakpointLocationList.cpp b/lldb/source/Breakpoint/BreakpointLocationList.cpp
index 22a4ff0c68e..341b0971630 100644
--- a/lldb/source/Breakpoint/BreakpointLocationList.cpp
+++ b/lldb/source/Breakpoint/BreakpointLocationList.cpp
@@ -41,7 +41,7 @@ BreakpointLocationList::Create (const Address &addr)
Mutex::Locker locker (m_mutex);
// The location ID is just the size of the location list + 1
lldb::break_id_t bp_loc_id = ++m_next_id;
- BreakpointLocationSP bp_loc_sp (new BreakpointLocation (bp_loc_id, m_owner, addr));
+ BreakpointLocationSP bp_loc_sp (new BreakpointLocation (bp_loc_id, m_owner, addr, LLDB_INVALID_THREAD_ID, m_owner.IsHardware()));
m_locations.push_back (bp_loc_sp);
m_address_to_location[addr] = bp_loc_sp;
return bp_loc_sp;
diff --git a/lldb/source/Breakpoint/StoppointLocation.cpp b/lldb/source/Breakpoint/StoppointLocation.cpp
index 092caa5a932..9d8d9241253 100644
--- a/lldb/source/Breakpoint/StoppointLocation.cpp
+++ b/lldb/source/Breakpoint/StoppointLocation.cpp
@@ -23,8 +23,8 @@ using namespace lldb_private;
StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, bool hardware) :
m_loc_id(bid),
m_addr(addr),
- m_hw_preferred(hardware),
- m_hw_index(LLDB_INVALID_INDEX32),
+ m_hardware(hardware),
+ m_hardware_index(LLDB_INVALID_INDEX32),
m_byte_size(0),
m_hit_count(0)
{
@@ -33,8 +33,8 @@ StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, bool hardware
StoppointLocation::StoppointLocation (break_id_t bid, addr_t addr, uint32_t byte_size, bool hardware) :
m_loc_id(bid),
m_addr(addr),
- m_hw_preferred(hardware),
- m_hw_index(LLDB_INVALID_INDEX32),
+ m_hardware(hardware),
+ m_hardware_index(LLDB_INVALID_INDEX32),
m_byte_size(byte_size),
m_hit_count(0)
{
OpenPOWER on IntegriCloud