[Lldb-commits] [lldb] Make SBBreakpoint/SBBreakpointLocation.SetCondition(nullptr) work again. (PR #162370)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Oct 7 13:51:45 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- lldb/unittests/Breakpoint/BreakpointClearConditionTest.cpp lldb/source/API/SBBreakpoint.cpp lldb/source/API/SBBreakpointLocation.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/unittests/Breakpoint/BreakpointClearConditionTest.cpp b/lldb/unittests/Breakpoint/BreakpointClearConditionTest.cpp
index 688c85a4a..f5c92c21a 100644
--- a/lldb/unittests/Breakpoint/BreakpointClearConditionTest.cpp
+++ b/lldb/unittests/Breakpoint/BreakpointClearConditionTest.cpp
@@ -42,8 +42,7 @@ public:
SubsystemRAII<FileSystem, HostInfo, PlatformMacOSX> subsystems;
};
-template<typename T>
-void test_condition(T sb_object) {
+template <typename T> void test_condition(T sb_object) {
const char *in_cond_str = "Here is a condition";
sb_object.SetCondition(in_cond_str);
// Make sure we set the condition correctly:
@@ -56,7 +55,7 @@ void test_condition(T sb_object) {
out_cond_str = sb_object.GetCondition();
// And make sure an unset condition returns nullptr:
EXPECT_EQ(nullptr, out_cond_str);
- }
+ }
}
TEST_F(BreakpointClearConditionTest, BreakpointClearConditionTest) {
@@ -66,20 +65,19 @@ TEST_F(BreakpointClearConditionTest, BreakpointClearConditionTest) {
// Create target
SBTarget sb_target;
SBError error;
- sb_target = m_sb_debugger.CreateTarget("", "x86_64-apple-macosx-", "remote-macosx",
- /*add_dependent=*/ false, error);
+ sb_target =
+ m_sb_debugger.CreateTarget("", "x86_64-apple-macosx-", "remote-macosx",
+ /*add_dependent=*/false, error);
EXPECT_EQ(sb_target.IsValid(), true);
// Create breakpoint
- SBBreakpoint sb_breakpoint =
- sb_target.BreakpointCreateByAddress(0xDEADBEEF);
+ SBBreakpoint sb_breakpoint = sb_target.BreakpointCreateByAddress(0xDEADBEEF);
test_condition(sb_breakpoint);
-
+
// Address breakpoints always have one location, so we can also use this
// to test the location:
SBBreakpointLocation sb_loc = sb_breakpoint.GetLocationAtIndex(0);
EXPECT_EQ(sb_loc.IsValid(), true);
test_condition(sb_loc);
-
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/162370
More information about the lldb-commits
mailing list