diff options
Diffstat (limited to 'source/Target/ThreadPlanRunToAddress.cpp')
-rw-r--r-- | source/Target/ThreadPlanRunToAddress.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/Target/ThreadPlanRunToAddress.cpp b/source/Target/ThreadPlanRunToAddress.cpp index 6d1a8b5c27ff..bd11f8b82f78 100644 --- a/source/Target/ThreadPlanRunToAddress.cpp +++ b/source/Target/ThreadPlanRunToAddress.cpp @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -// C Includes -// C++ Includes -// Other libraries and framework includes -// Project includes #include "lldb/Target/ThreadPlanRunToAddress.h" #include "lldb/Target/Process.h" #include "lldb/Target/RegisterContext.h" @@ -73,6 +69,8 @@ void ThreadPlanRunToAddress::SetInitialBreakpoints() { ->CreateBreakpoint(m_addresses[i], true, false) .get(); if (breakpoint != nullptr) { + if (breakpoint->IsHardware() && !breakpoint->HasResolvedLocations()) + m_could_not_resolve_hw_bp = true; m_break_ids[i] = breakpoint->GetID(); breakpoint->SetThreadID(m_thread.GetID()); breakpoint->SetBreakpointKind("run-to-address"); @@ -85,6 +83,7 @@ ThreadPlanRunToAddress::~ThreadPlanRunToAddress() { for (size_t i = 0; i < num_break_ids; i++) { m_thread.CalculateTarget()->RemoveBreakpointByID(m_break_ids[i]); } + m_could_not_resolve_hw_bp = false; } void ThreadPlanRunToAddress::GetDescription(Stream *s, @@ -133,10 +132,15 @@ void ThreadPlanRunToAddress::GetDescription(Stream *s, } bool ThreadPlanRunToAddress::ValidatePlan(Stream *error) { + if (m_could_not_resolve_hw_bp) { + if (error) + error->Printf("Could not set hardware breakpoint(s)"); + return false; + } + // If we couldn't set the breakpoint for some reason, then this won't work. bool all_bps_good = true; size_t num_break_ids = m_break_ids.size(); - for (size_t i = 0; i < num_break_ids; i++) { if (m_break_ids[i] == LLDB_INVALID_BREAK_ID) { all_bps_good = false; |