diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
| commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
| tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp | |
| parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
| parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp')
| -rw-r--r-- | contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp | 25 | 
1 files changed, 18 insertions, 7 deletions
| diff --git a/contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp b/contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp index 8159b851d58c..eb75bf8b33f4 100644 --- a/contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp +++ b/contrib/llvm-project/lldb/source/API/SBBreakpoint.cpp @@ -1,4 +1,4 @@ -//===-- SBBreakpoint.cpp ----------------------------------------*- C++ -*-===// +//===-- SBBreakpoint.cpp --------------------------------------------------===//  //  // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.  // See https://llvm.org/LICENSE.txt for license information. @@ -652,19 +652,28 @@ SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {  bool SBBreakpoint::AddName(const char *new_name) {    LLDB_RECORD_METHOD(bool, SBBreakpoint, AddName, (const char *), new_name); +  SBError status = AddNameWithErrorHandling(new_name); +  return status.Success(); +} + +SBError SBBreakpoint::AddNameWithErrorHandling(const char *new_name) { +  LLDB_RECORD_METHOD(SBError, SBBreakpoint, AddNameWithErrorHandling, +                     (const char *), new_name); +    BreakpointSP bkpt_sp = GetSP(); +  SBError status;    if (bkpt_sp) {      std::lock_guard<std::recursive_mutex> guard(          bkpt_sp->GetTarget().GetAPIMutex()); -    Status error; // Think I'm just going to swallow the error here, it's -                  // probably more annoying to have to provide it. +    Status error;      bkpt_sp->GetTarget().AddNameToBreakpoint(bkpt_sp, new_name, error); -    if (error.Fail()) -      return false; +    status.SetError(error); +  } else { +    status.SetErrorString("invalid breakpoint");    } -  return true; +  return LLDB_RECORD_RESULT(status);  }  void SBBreakpoint::RemoveName(const char *name_to_remove) { @@ -873,7 +882,7 @@ SBBreakpointList::SBBreakpointList(SBTarget &target)    LLDB_RECORD_CONSTRUCTOR(SBBreakpointList, (lldb::SBTarget &), target);  } -SBBreakpointList::~SBBreakpointList() {} +SBBreakpointList::~SBBreakpointList() = default;  size_t SBBreakpointList::GetSize() const {    LLDB_RECORD_METHOD_CONST_NO_ARGS(size_t, SBBreakpointList, GetSize); @@ -1015,6 +1024,8 @@ void RegisterMethods<SBBreakpoint>(Registry &R) {    LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpoint, SetScriptCallbackBody,                         (const char *));    LLDB_REGISTER_METHOD(bool, SBBreakpoint, AddName, (const char *)); +  LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpoint, AddNameWithErrorHandling, +                       (const char *));    LLDB_REGISTER_METHOD(void, SBBreakpoint, RemoveName, (const char *));    LLDB_REGISTER_METHOD(bool, SBBreakpoint, MatchesName, (const char *));    LLDB_REGISTER_METHOD(void, SBBreakpoint, GetNames, (lldb::SBStringList &)); | 
