[Lldb-commits] [lldb] Handle step-in over a Darwin "branch island". (PR #138330)
via lldb-commits
lldb-commits at lists.llvm.org
Fri May 2 12:45:14 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 HEAD~1 HEAD --extensions cpp,c -- lldb/test/API/macosx/branch-islands/foo.c lldb/test/API/macosx/branch-islands/main.c lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 0c5e69f47..52c50cd88 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -925,7 +925,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
std::vector<Address> addresses;
ConstString current_name =
- current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
+ current_symbol->GetMangled().GetName(Mangled::ePreferMangled);
if (current_symbol->IsTrampoline()) {
if (current_name) {
@@ -946,8 +946,8 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}
SymbolContextList reexported_symbols;
- images.FindSymbolsWithNameAndType(
- current_name, eSymbolTypeReExported, reexported_symbols);
+ images.FindSymbolsWithNameAndType(current_name, eSymbolTypeReExported,
+ reexported_symbols);
for (const SymbolContext &context : reexported_symbols) {
if (context.symbol) {
Symbol *actual_symbol =
@@ -1003,7 +1003,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}
}
}
-
+
if (addresses.size() > 0) {
// First check whether any of the addresses point to Indirect symbols,
// and if they do, resolve them:
@@ -1031,15 +1031,15 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}
// One more case we have to consider is "branch islands". These are regular
// TEXT symbols but their names end in .island. They are to allow arm64
- // code to branch further than the size of the address slot allows. We
+ // code to branch further than the size of the address slot allows. We
// just need to single-instruction step in that case.
if (!thread_plan_sp && current_name.GetStringRef().ends_with(".island")) {
- thread_plan_sp = std::make_shared<ThreadPlanStepInstruction>(thread,
- /* step_over= */ false, /* stop_others */ false, eVoteNoOpinion,
+ thread_plan_sp = std::make_shared<ThreadPlanStepInstruction>(
+ thread,
+ /* step_over= */ false, /* stop_others */ false, eVoteNoOpinion,
eVoteNoOpinion);
- LLDB_LOG(log,
- "Stepping one instruction over branch island: '{0}'.",
- current_name);
+ LLDB_LOG(log, "Stepping one instruction over branch island: '{0}'.",
+ current_name);
}
} else {
LLDB_LOGF(log, "Could not find symbol for step through.");
diff --git a/lldb/test/API/macosx/branch-islands/foo.c b/lldb/test/API/macosx/branch-islands/foo.c
index 6de2c7f36..a5dd2e59e 100644
--- a/lldb/test/API/macosx/branch-islands/foo.c
+++ b/lldb/test/API/macosx/branch-islands/foo.c
@@ -1,8 +1,6 @@
#include <stdio.h>
-void
-foo()
-{
+void foo() {
int a_variable_in_foo = 10;
printf("I am foo: %d.\n", a_variable_in_foo);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/138330
More information about the lldb-commits
mailing list