aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBBreakpoint.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/API/SBBreakpoint.cpp')
-rw-r--r--lldb/source/API/SBBreakpoint.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index 07c0a2e..04af7a3 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -275,7 +275,11 @@ void SBBreakpoint::SetCondition(const char *condition) {
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
- bkpt_sp->SetCondition(StopCondition(condition));
+ // Treat a null pointer as resetting the condition.
+ if (!condition)
+ bkpt_sp->SetCondition(StopCondition());
+ else
+ bkpt_sp->SetCondition(StopCondition(condition));
}
}
@@ -288,7 +292,10 @@ const char *SBBreakpoint::GetCondition() {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
- return ConstString(bkpt_sp->GetCondition().GetText()).GetCString();
+ StopCondition cond = bkpt_sp->GetCondition();
+ if (!cond)
+ return nullptr;
+ return ConstString(cond.GetText()).GetCString();
}
void SBBreakpoint::SetAutoContinue(bool auto_continue) {
@@ -567,6 +574,15 @@ SBError SBBreakpoint::AddLocation(SBAddress &address) {
return error;
}
+SBBreakpointLocation SBBreakpoint::AddFacadeLocation() {
+ BreakpointSP bkpt_sp = GetSP();
+ if (!bkpt_sp)
+ return {};
+
+ BreakpointLocationSP loc_sp = bkpt_sp->AddFacadeLocation();
+ return SBBreakpointLocation(loc_sp);
+}
+
SBStructuredData SBBreakpoint::SerializeToStructuredData() {
LLDB_INSTRUMENT_VA(this);