Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions lldb/source/API/SBBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,7 @@ void SBBreakpoint::SetCondition(const char *condition) {
if (bkpt_sp) {
std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
// Treat a null pointer as resetting the condition.
if (!condition)
bkpt_sp->SetCondition(StopCondition());
else
bkpt_sp->SetCondition(StopCondition(condition));
bkpt_sp->SetCondition(StopCondition(condition));
}
}

Expand All @@ -292,10 +288,7 @@ const char *SBBreakpoint::GetCondition() {

std::lock_guard<std::recursive_mutex> guard(
bkpt_sp->GetTarget().GetAPIMutex());
StopCondition cond = bkpt_sp->GetCondition();
if (!cond)
return nullptr;
return ConstString(cond.GetText()).GetCString();
return ConstString(bkpt_sp->GetCondition().GetText()).GetCString();
}

void SBBreakpoint::SetAutoContinue(bool auto_continue) {
Expand Down
11 changes: 2 additions & 9 deletions lldb/source/API/SBBreakpointLocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ void SBBreakpointLocation::SetCondition(const char *condition) {
if (loc_sp) {
std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
// Treat a nullptr as clearing the condition
if (!condition)
loc_sp->SetCondition(StopCondition());
else
loc_sp->SetCondition(StopCondition(condition));
loc_sp->SetCondition(StopCondition(condition));
}
}

Expand All @@ -177,10 +173,7 @@ const char *SBBreakpointLocation::GetCondition() {

std::lock_guard<std::recursive_mutex> guard(
loc_sp->GetTarget().GetAPIMutex());
StopCondition cond = loc_sp->GetCondition();
if (!cond)
return nullptr;
return ConstString(cond.GetText()).GetCString();
return ConstString(loc_sp->GetCondition().GetText()).GetCString();
}

void SBBreakpointLocation::SetAutoContinue(bool auto_continue) {
Expand Down
1 change: 0 additions & 1 deletion lldb/unittests/API/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ add_lldb_unittest(APITests
SBCommandInterpreterTest.cpp
SBLineEntryTest.cpp
SBMutexTest.cpp
SBBreakpointClearConditionTest.cpp

SBAPITEST

Expand Down
69 changes: 0 additions & 69 deletions lldb/unittests/API/SBBreakpointClearConditionTest.cpp

This file was deleted.

6 changes: 1 addition & 5 deletions lldb/unittests/Breakpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
add_lldb_unittest(LLDBBreakpointTests
add_lldb_unittest(LLDBBreakpointTests
BreakpointIDTest.cpp
WatchpointAlgorithmsTests.cpp

LINK_COMPONENTS
Support
LINK_LIBS
liblldb
lldbBreakpoint
lldbCore
LLVMTestingSupport
lldbUtilityHelpers
lldbPluginPlatformMacOSX
)
Loading