[Lldb-commits] [lldb] [lldb] Prepare UnwindPlans for discontinuous functions (PR #127661)
via lldb-commits
lldb-commits at lists.llvm.org
Tue Feb 18 08:16:51 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Pavel Labath (labath)
<details>
<summary>Changes</summary>
The main changes are:
- changing the internal row representation from vector to a map. This
wasn't strictly necessary, but I'm doing it because due the functions
not starting at the lowest address, the Row for the function entry
point (offset zero) may no longer be the first (zeroth) entry in the
vector, so we will need to (binary) search for it. This would have
been possible with a (sorted) vector representation as well, but that's
somewhat tricky because the unwind plans are constructed in place, so
there isn't a good place to insert a sort operations (the plans are
currently implicitly sorted due to the sequential nature of their
construction, but that will be harder to ensure when jumping between
multiple regions).
- changing the valid address range from singular to plural
The changes to other files are due to the address range pluralization
and due to the removal of `AppendRow` (as there isn't really an "append"
operation in a map).
---
Patch is 52.58 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/127661.diff
35 Files Affected:
- (modified) lldb/include/lldb/Symbol/UnwindPlan.h (+12-20)
- (modified) lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp (+1-1)
- (modified) lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp (+1-1)
- (modified) lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp (+2-2)
- (modified) lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp (+2-2)
- (modified) lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (+1-1)
- (modified) lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp (+1-1)
- (modified) lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp (+1-1)
- (modified) lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp (+1-1)
- (modified) lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp (+1-1)
- (modified) lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp (+3-3)
- (modified) lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp (+1-1)
- (modified) lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp (+9-9)
- (modified) lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp (+5-5)
- (modified) lldb/source/Symbol/ArmUnwindInfo.cpp (+1-1)
- (modified) lldb/source/Symbol/CompactUnwindInfo.cpp (+8-8)
- (modified) lldb/source/Symbol/DWARFCallFrameInfo.cpp (+7-7)
- (modified) lldb/source/Symbol/UnwindPlan.cpp (+41-73)
- (modified) lldb/unittests/Symbol/CMakeLists.txt (+1)
- (added) lldb/unittests/Symbol/UnwindPlanTest.cpp (+76)
- (modified) lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp (+12-12)
``````````diff
diff --git a/lldb/include/lldb/Symbol/UnwindPlan.h b/lldb/include/lldb/Symbol/UnwindPlan.h
index 48c9bef76857c..1585fb69172a5 100644
--- a/lldb/include/lldb/Symbol/UnwindPlan.h
+++ b/lldb/include/lldb/Symbol/UnwindPlan.h
@@ -436,7 +436,7 @@ class UnwindPlan {
// Performs a deep copy of the plan, including all the rows (expensive).
UnwindPlan(const UnwindPlan &rhs)
- : m_plan_valid_address_range(rhs.m_plan_valid_address_range),
+ : m_plan_valid_ranges(rhs.m_plan_valid_ranges),
m_register_kind(rhs.m_register_kind),
m_return_addr_register(rhs.m_return_addr_register),
m_source_name(rhs.m_source_name),
@@ -446,18 +446,15 @@ class UnwindPlan {
m_plan_is_for_signal_trap(rhs.m_plan_is_for_signal_trap),
m_lsda_address(rhs.m_lsda_address),
m_personality_func_addr(rhs.m_personality_func_addr) {
- m_row_list.reserve(rhs.m_row_list.size());
- for (const RowSP &row_sp : rhs.m_row_list)
- m_row_list.emplace_back(new Row(*row_sp));
+ for (const auto &[offset, row_sp] : rhs.m_rows)
+ m_rows.emplace(offset, std::make_shared<Row>(*row_sp));
}
~UnwindPlan() = default;
void Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const;
- void AppendRow(const RowSP &row_sp);
-
- void InsertRow(const RowSP &row_sp, bool replace_existing = false);
+ void InsertRow(const RowSP &row_sp, bool replace_existing = true);
// Returns a pointer to the best row for the given offset into the function's
// instructions. If offset is -1 it indicates that the function start is
@@ -477,19 +474,15 @@ class UnwindPlan {
uint32_t GetReturnAddressRegister() { return m_return_addr_register; }
uint32_t GetInitialCFARegister() const {
- if (m_row_list.empty())
- return LLDB_INVALID_REGNUM;
- return m_row_list.front()->GetCFAValue().GetRegisterNumber();
+ if (auto it = m_rows.find(0); it != m_rows.end())
+ return it->second->GetCFAValue().GetRegisterNumber();
+ return LLDB_INVALID_REGNUM;
}
// This UnwindPlan may not be valid at every address of the function span.
// For instance, a FastUnwindPlan will not be valid at the prologue setup
// instructions - only in the body of the function.
- void SetPlanValidAddressRange(const AddressRange &range);
-
- const AddressRange &GetAddressRange() const {
- return m_plan_valid_address_range;
- }
+ void SetPlanValidAddressRanges(std::vector<AddressRange> ranges);
bool PlanValidAtAddress(Address addr);
@@ -540,8 +533,8 @@ class UnwindPlan {
int GetRowCount() const;
void Clear() {
- m_row_list.clear();
- m_plan_valid_address_range.Clear();
+ m_rows.clear();
+ m_plan_valid_ranges.clear();
m_register_kind = lldb::eRegisterKindDWARF;
m_source_name.Clear();
m_plan_is_sourced_from_compiler = eLazyBoolCalculate;
@@ -564,9 +557,8 @@ class UnwindPlan {
}
private:
- typedef std::vector<RowSP> collection;
- collection m_row_list;
- AddressRange m_plan_valid_address_range;
+ std::map<lldb::addr_t, RowSP> m_rows;
+ std::vector<AddressRange> m_plan_valid_ranges;
lldb::RegisterKind m_register_kind; // The RegisterKind these register numbers
// are in terms of - will need to be
// translated to lldb native reg nums at unwind time
diff --git a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
index cb121c14048f0..4420a60a8d8fd 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
@@ -359,7 +359,7 @@ bool ABIMacOSX_arm64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// Our previous PC is in the LR
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -386,7 +386,7 @@ bool ABIMacOSX_arm64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("arm64-apple-darwin default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
index 74047ea65788c..39123b1961d81 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
@@ -403,7 +403,7 @@ bool ABISysV_arm64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// Our previous Call Frame Address is the stack pointer
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 0);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetReturnAddressRegister(lr_reg_num);
// All other registers are the same.
@@ -433,7 +433,7 @@ bool ABISysV_arm64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("arm64 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
index 6f60663ca51e1..709b251844210 100644
--- a/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
+++ b/lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp
@@ -566,7 +566,7 @@ bool ABISysV_arc::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the BLINK.
row->SetRegisterLocationToRegister(dwarf::pc, dwarf::blink, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
unwind_plan.SetSourceName("arc at-func-entry default");
diff --git a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
index 6aadf652da781..2bf56422b8e63 100644
--- a/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp
@@ -1796,7 +1796,7 @@ bool ABIMacOSX_arm::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the LR
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -1824,7 +1824,7 @@ bool ABIMacOSX_arm::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("arm-apple-ios default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
index d67591ffa109b..86dcdaa4a8c65 100644
--- a/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
+++ b/lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp
@@ -1911,7 +1911,7 @@ bool ABISysV_arm::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the LR
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -1939,7 +1939,7 @@ bool ABISysV_arm::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("arm default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
index 5419f054cbe2d..c98ea7eab8dee 100644
--- a/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
+++ b/lldb/source/Plugins/ABI/Hexagon/ABISysV_hexagon.cpp
@@ -1209,7 +1209,7 @@ bool ABISysV_hexagon::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the LR
row->SetRegisterLocationToRegister(LLDB_REGNUM_GENERIC_PC,
LLDB_REGNUM_GENERIC_RA, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("hexagon at-func-entry default");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
@@ -1233,7 +1233,7 @@ bool ABISysV_hexagon::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("hexagon default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp b/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
index dc7e9bba00067..d45deb9bea70d 100644
--- a/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
+++ b/lldb/source/Plugins/ABI/LoongArch/ABISysV_loongarch.cpp
@@ -548,7 +548,7 @@ bool ABISysV_loongarch::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// Previous frame's pc is in ra
row->SetRegisterLocationToRegister(pc_reg_num, ra_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("loongarch function-entry unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
@@ -577,7 +577,7 @@ bool ABISysV_loongarch::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, reg_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, reg_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("loongarch default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp b/lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp
index 6f0fd3a6e8f6f..48afd24712394 100644
--- a/lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp
+++ b/lldb/source/Plugins/ABI/MSP430/ABISysV_msp430.cpp
@@ -317,7 +317,7 @@ bool ABISysV_msp430::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -2, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("msp430 at-func-entry default");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
return true;
@@ -337,7 +337,7 @@ bool ABISysV_msp430::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
row->SetRegisterLocationToUnspecified(fp_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("msp430 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
index 9c7312b975c4b..762485614fc45 100644
--- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
+++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp
@@ -965,7 +965,7 @@ bool ABISysV_mips::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the RA
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -986,7 +986,7 @@ bool ABISysV_mips::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("mips default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
index 4cc37dd7acf09..0864f397f8b29 100644
--- a/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
+++ b/lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp
@@ -1138,7 +1138,7 @@ bool ABISysV_mips64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the RA
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -1159,7 +1159,7 @@ bool ABISysV_mips64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToRegister(dwarf_pc, dwarf_r31, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("mips64 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
index e482b8d4c4c46..0693f0151ae4e 100644
--- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
+++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp
@@ -872,7 +872,7 @@ bool ABISysV_ppc::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the LR
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -898,7 +898,7 @@ bool ABISysV_ppc::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * 1, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("ppc default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
index 0aa51ef654274..0f15e6e0554a0 100644
--- a/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
+++ b/lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp
@@ -979,7 +979,7 @@ bool ABISysV_ppc64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// The previous PC is in the LR
row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
// All other registers are the same.
@@ -1016,7 +1016,7 @@ bool ABISysV_ppc64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
row->SetRegisterLocationToAtCFAPlusOffset(cr_reg_num, ptr_size, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("ppc64 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
index 8412991933d27..b35288bebddcf 100644
--- a/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
+++ b/lldb/source/Plugins/ABI/RISCV/ABISysV_riscv.cpp
@@ -734,7 +734,7 @@ bool ABISysV_riscv::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
// Previous frame's pc is in ra
row->SetRegisterLocationToRegister(pc_reg_num, ra_reg_num, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("riscv function-entry unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
@@ -763,7 +763,7 @@ bool ABISysV_riscv::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, reg_size * -2, true);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, reg_size * -1, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("riscv default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
index 82853c96a0f74..0690501dc1710 100644
--- a/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
+++ b/lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp
@@ -630,7 +630,7 @@ bool ABISysV_s390x::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToRegister(dwarf_pswa_s390x, dwarf_r14_s390x, true);
// All other registers are the same.
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("s390x at-func-entry default");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
return true;
diff --git a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
index f03acbcedb351..384fac92a0cc2 100644
--- a/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIMacOSX_i386.cpp
@@ -367,7 +367,7 @@ bool ABIMacOSX_i386::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 4);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("i386 at-func-entry default");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
return true;
@@ -397,7 +397,7 @@ bool ABIMacOSX_i386::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("i386 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp
index 19ec5fa49bbea..2441dd05e5f68 100644
--- a/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp
@@ -634,7 +634,7 @@ bool ABISysV_i386::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 4);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("i386 at-func-entry default");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
return true;
@@ -664,7 +664,7 @@ bool ABISysV_i386::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- unwind_plan.AppendRow(row);
+ unwind_plan.InsertRow(row);
unwind_plan.SetSourceName("i386 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
index 83b01b14aedc5..ee1854096a37e 100644
--- a/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp
@@ -869,7 +869,7 @@ bool ABISysV_x86_64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/127661
More information about the lldb-commits
mailing list