diff options
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r-- | lldb/source/Target/Target.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index 5e175d633ba..203355f7657 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -772,10 +772,16 @@ bool Target::ProcessIsValid() { return (m_process_sp && m_process_sp->IsAlive()); } -static bool CheckIfWatchpointsExhausted(Target *target, Status &error) { +static bool CheckIfWatchpointsSupported(Target *target, Status &error) { uint32_t num_supported_hardware_watchpoints; Status rc = target->GetProcessSP()->GetWatchpointSupportInfo( num_supported_hardware_watchpoints); + + // If unable to determine the # of watchpoints available, + // assume they are supported. + if (rc.Fail()) + return true; + if (num_supported_hardware_watchpoints == 0) { error.SetErrorStringWithFormat( "Target supports (%u) hardware watchpoint slots.\n", @@ -814,7 +820,7 @@ WatchpointSP Target::CreateWatchpoint(lldb::addr_t addr, size_t size, error.SetErrorStringWithFormat("invalid watchpoint type: %d", kind); } - if (!CheckIfWatchpointsExhausted(this, error)) + if (!CheckIfWatchpointsSupported(this, error)) return wp_sp; // Currently we only support one watchpoint per address, with total number of |