[Lldb-commits] [lldb] [lldb] Merge/unify ABI-provided AArch64 unwind plans (PR #139545)

via lldb-commits lldb-commits at lists.llvm.org
Mon May 12 06:39:31 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 h,cpp -- lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp lldb/source/Plugins/ABI/AArch64/ABIAArch64.h lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.h lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h lldb/source/Symbol/FuncUnwinders.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
index 58b8459b1..3bafb21f7 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp
@@ -209,7 +209,8 @@ UnwindPlanSP ABIAArch64::CreateFunctionEntryUnwindPlan() {
   row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_SP, 0);
 
   // Our previous PC is in the LR, all other registers are the same.
-  row.SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, true);
+  row.SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC,
+                                    LLDB_REGNUM_GENERIC_RA, true);
 
   auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
   plan_sp->AppendRow(std::move(row));
@@ -224,11 +225,14 @@ UnwindPlanSP ABIAArch64::CreateDefaultUnwindPlan() {
   UnwindPlan::Row row;
   const int32_t ptr_size = 8;
 
-  row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_FP, 2 * ptr_size);
+  row.GetCFAValue().SetIsRegisterPlusOffset(LLDB_REGNUM_GENERIC_FP,
+                                            2 * ptr_size);
   row.SetUnspecifiedRegistersAreUndefined(true);
 
-  row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_FP, ptr_size * -2, true);
-  row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_PC, ptr_size * -1, true);
+  row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_FP,
+                                           ptr_size * -2, true);
+  row.SetRegisterLocationToAtCFAPlusOffset(LLDB_REGNUM_GENERIC_PC,
+                                           ptr_size * -1, true);
 
   auto plan_sp = std::make_shared<UnwindPlan>(eRegisterKindGeneric);
   plan_sp->AppendRow(std::move(row));
@@ -238,4 +242,3 @@ UnwindPlanSP ABIAArch64::CreateDefaultUnwindPlan() {
   plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
   return plan_sp;
 }
-
diff --git a/lldb/source/Symbol/FuncUnwinders.cpp b/lldb/source/Symbol/FuncUnwinders.cpp
index 8f3e3d0a9..12a6d101d 100644
--- a/lldb/source/Symbol/FuncUnwinders.cpp
+++ b/lldb/source/Symbol/FuncUnwinders.cpp
@@ -365,12 +365,12 @@ FuncUnwinders::GetAssemblyUnwindPlan(Target &target, Thread &thread) {
 LazyBool FuncUnwinders::CompareUnwindPlansForIdenticalInitialPCLocation(
     Thread &thread, const std::shared_ptr<const UnwindPlan> &a,
     const std::shared_ptr<const UnwindPlan> &b) {
-  if (!a ||!b)
+  if (!a || !b)
     return eLazyBoolCalculate;
 
   const UnwindPlan::Row *a_first_row = a->GetRowAtIndex(0);
   const UnwindPlan::Row *b_first_row = b->GetRowAtIndex(0);
-  if (!a_first_row ||! b_first_row)
+  if (!a_first_row || !b_first_row)
     return eLazyBoolCalculate;
 
   RegisterNumber pc_reg(thread, eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);

``````````

</details>


https://github.com/llvm/llvm-project/pull/139545


More information about the lldb-commits mailing list