[Lldb-commits] [lldb] [lldb] Prepare UnwindPlans for discontinuous functions (PR #127661)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 18 08:16:14 PST 2025


https://github.com/labath created https://github.com/llvm/llvm-project/pull/127661

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).

>From 431345f9d7b6da285a36620d5862ceffd93c10ec Mon Sep 17 00:00:00 2001
From: Pavel Labath <pavel at labath.sk>
Date: Tue, 18 Feb 2025 16:14:30 +0100
Subject: [PATCH] [lldb] Prepare UnwindPlans for discontinuous functions

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).
---
 lldb/include/lldb/Symbol/UnwindPlan.h         |  32 ++---
 .../Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp   |   4 +-
 .../Plugins/ABI/AArch64/ABISysV_arm64.cpp     |   4 +-
 lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp   |   2 +-
 lldb/source/Plugins/ABI/ARM/ABIMacOSX_arm.cpp |   4 +-
 lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp   |   4 +-
 .../Plugins/ABI/Hexagon/ABISysV_hexagon.cpp   |   4 +-
 .../ABI/LoongArch/ABISysV_loongarch.cpp       |   4 +-
 .../Plugins/ABI/MSP430/ABISysV_msp430.cpp     |   4 +-
 lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp |   4 +-
 .../Plugins/ABI/Mips/ABISysV_mips64.cpp       |   4 +-
 .../Plugins/ABI/PowerPC/ABISysV_ppc.cpp       |   4 +-
 .../Plugins/ABI/PowerPC/ABISysV_ppc64.cpp     |   4 +-
 .../Plugins/ABI/RISCV/ABISysV_riscv.cpp       |   4 +-
 .../Plugins/ABI/SystemZ/ABISysV_s390x.cpp     |   2 +-
 .../source/Plugins/ABI/X86/ABIMacOSX_i386.cpp |   4 +-
 lldb/source/Plugins/ABI/X86/ABISysV_i386.cpp  |   4 +-
 .../source/Plugins/ABI/X86/ABISysV_x86_64.cpp |   4 +-
 .../Plugins/ABI/X86/ABIWindows_x86_64.cpp     |   4 +-
 .../Instruction/ARM/EmulateInstructionARM.cpp |   2 +-
 .../ARM64/EmulateInstructionARM64.cpp         |   2 +-
 .../MIPS/EmulateInstructionMIPS.cpp           |   2 +-
 .../MIPS64/EmulateInstructionMIPS64.cpp       |   2 +-
 .../PPC64/EmulateInstructionPPC64.cpp         |   2 +-
 .../ObjectFile/PECOFF/PECallFrameInfo.cpp     |   6 +-
 .../Plugins/Platform/Linux/PlatformLinux.cpp  |   2 +-
 .../Breakpad/SymbolFileBreakpad.cpp           |  18 +--
 .../x86/x86AssemblyInspectionEngine.cpp       |  10 +-
 lldb/source/Symbol/ArmUnwindInfo.cpp          |   2 +-
 lldb/source/Symbol/CompactUnwindInfo.cpp      |  16 +--
 lldb/source/Symbol/DWARFCallFrameInfo.cpp     |  14 +--
 lldb/source/Symbol/UnwindPlan.cpp             | 114 +++++++-----------
 lldb/unittests/Symbol/CMakeLists.txt          |   1 +
 lldb/unittests/Symbol/UnwindPlanTest.cpp      |  76 ++++++++++++
 .../x86/Testx86AssemblyInspectionEngine.cpp   |  24 ++--
 35 files changed, 215 insertions(+), 178 deletions(-)
 create mode 100644 lldb/unittests/Symbol/UnwindPlanTest.cpp

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, 8);
   row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
   row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("x86_64 at-func-entry default");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   return true;
@@ -899,7 +899,7 @@ bool ABISysV_x86_64::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("x86_64 default unwind plan");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
index 098293c1d6046..3451bd4dba9b8 100644
--- a/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp
@@ -749,7 +749,7 @@ bool ABIWindows_x86_64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
   row->GetCFAValue().SetIsRegisterPlusOffset(sp_reg_num, 8);
   row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
   row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("x86_64 at-func-entry default");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   return true;
@@ -777,7 +777,7 @@ bool ABIWindows_x86_64::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("x86_64 default unwind plan");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
index 147c00e51b40d..634bffab5b7a2 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -14463,7 +14463,7 @@ bool EmulateInstructionARM::CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) {
   // Our previous Call Frame Address is the stack pointer
   row->GetCFAValue().SetIsRegisterPlusOffset(dwarf_sp, 0);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("EmulateInstructionARM");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes);
diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
index 62ecac3e0831d..ed2ce4a68c2a4 100644
--- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -447,7 +447,7 @@ bool EmulateInstructionARM64::CreateFunctionEntryUnwind(
   row->SetRegisterLocationToSame(gpr_lr_arm64, /*must_replace=*/false);
   row->SetRegisterLocationToSame(gpr_fp_arm64, /*must_replace=*/false);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("EmulateInstructionARM64");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes);
diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index 76d7a8272f3fc..7353d42b9ba24 100644
--- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -1137,7 +1137,7 @@ bool EmulateInstructionMIPS::CreateFunctionEntryUnwind(
   // Our previous PC is in the RA
   row->SetRegisterLocationToRegister(dwarf_pc_mips, dwarf_ra_mips, can_replace);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
 
   // All other registers are the same.
   unwind_plan.SetSourceName("EmulateInstructionMIPS");
diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
index e33ca95b523be..e7e9cbb9ad1a3 100644
--- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -1027,7 +1027,7 @@ bool EmulateInstructionMIPS64::CreateFunctionEntryUnwind(
   row->SetRegisterLocationToRegister(dwarf_pc_mips64, dwarf_ra_mips64,
                                      can_replace);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
 
   // All other registers are the same.
   unwind_plan.SetSourceName("EmulateInstructionMIPS64");
diff --git a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
index 3035c51341778..94a9c2f342192 100644
--- a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
+++ b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
@@ -123,7 +123,7 @@ bool EmulateInstructionPPC64::CreateFunctionEntryUnwind(
   // Our previous Call Frame Address is the stack pointer
   row->GetCFAValue().SetIsRegisterPlusOffset(gpr_r1_ppc64le, 0);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("EmulateInstructionPPC64");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes);
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
index 9bd48f2b9f60f..cdc4f85c3f8bf 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/PECallFrameInfo.cpp
@@ -493,11 +493,11 @@ bool PECallFrameInfo::GetUnwindPlan(const AddressRange &range,
   }
 
   for (auto it = rows.rbegin(); it != rows.rend(); ++it)
-    unwind_plan.AppendRow(*it);
+    unwind_plan.InsertRow(*it);
 
-  unwind_plan.SetPlanValidAddressRange(AddressRange(
+  unwind_plan.SetPlanValidAddressRanges({AddressRange(
       m_object_file.GetAddress(runtime_function->StartAddress),
-      runtime_function->EndAddress - runtime_function->StartAddress));
+      runtime_function->EndAddress - runtime_function->StartAddress)});
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
 
   return true;
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index 13465986f49c5..3c727ebc14d58 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -276,7 +276,7 @@ static lldb::UnwindPlanSP GetAArch64TrapHandlerUnwindPlan(ConstString name) {
   // here.
 
   unwind_plan_sp = std::make_shared<UnwindPlan>(eRegisterKindDWARF);
-  unwind_plan_sp->AppendRow(row);
+  unwind_plan_sp->InsertRow(row);
   unwind_plan_sp->SetSourceName("AArch64 Linux sigcontext");
   unwind_plan_sp->SetSourcedFromCompiler(eLazyBoolYes);
   // Because sp is the same throughout the function
diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
index c7229568e1a0c..09782fe17777e 100644
--- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -656,15 +656,15 @@ SymbolFileBreakpad::ParseCFIUnwindPlan(const Bookmark &bookmark,
   plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
   plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
   plan_sp->SetSourcedFromCompiler(eLazyBoolYes);
-  plan_sp->SetPlanValidAddressRange(
-      AddressRange(base + init_record->Address, *init_record->Size,
-                   m_objfile_sp->GetModule()->GetSectionList()));
+  plan_sp->SetPlanValidAddressRanges(
+      {AddressRange(base + init_record->Address, *init_record->Size,
+                    m_objfile_sp->GetModule()->GetSectionList())});
 
   auto row_sp = std::make_shared<UnwindPlan::Row>();
   row_sp->SetOffset(0);
   if (!ParseCFIUnwindRow(init_record->UnwindRules, resolver, *row_sp))
     return nullptr;
-  plan_sp->AppendRow(row_sp);
+  plan_sp->InsertRow(row_sp);
   for (++It; It != End; ++It) {
     std::optional<StackCFIRecord> record = StackCFIRecord::parse(*It);
     if (!record)
@@ -676,7 +676,7 @@ SymbolFileBreakpad::ParseCFIUnwindPlan(const Bookmark &bookmark,
     row_sp->SetOffset(record->Address - init_record->Address);
     if (!ParseCFIUnwindRow(record->UnwindRules, resolver, *row_sp))
       return nullptr;
-    plan_sp->AppendRow(row_sp);
+    plan_sp->InsertRow(row_sp);
   }
   return plan_sp;
 }
@@ -698,9 +698,9 @@ SymbolFileBreakpad::ParseWinUnwindPlan(const Bookmark &bookmark,
   plan_sp->SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
   plan_sp->SetUnwindPlanForSignalTrap(eLazyBoolNo);
   plan_sp->SetSourcedFromCompiler(eLazyBoolYes);
-  plan_sp->SetPlanValidAddressRange(
-      AddressRange(base + record->RVA, record->CodeSize,
-                   m_objfile_sp->GetModule()->GetSectionList()));
+  plan_sp->SetPlanValidAddressRanges(
+      {AddressRange(base + record->RVA, record->CodeSize,
+                    m_objfile_sp->GetModule()->GetSectionList())});
 
   auto row_sp = std::make_shared<UnwindPlan::Row>();
   row_sp->SetOffset(0);
@@ -769,7 +769,7 @@ SymbolFileBreakpad::ParseWinUnwindPlan(const Bookmark &bookmark,
     row_sp->SetRegisterInfo(info->kinds[eRegisterKindLLDB], loc);
   }
 
-  plan_sp->AppendRow(row_sp);
+  plan_sp->InsertRow(row_sp);
   return plan_sp;
 }
 
diff --git a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
index 45d2f95433d5b..ee8628f9b1bc3 100644
--- a/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
@@ -918,7 +918,7 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
   UnwindPlan::Row::AbstractRegisterLocation initial_regloc;
   UnwindPlan::RowSP row(new UnwindPlan::Row);
 
-  unwind_plan.SetPlanValidAddressRange(func_range);
+  unwind_plan.SetPlanValidAddressRanges({func_range});
   unwind_plan.SetRegisterKind(eRegisterKindLLDB);
 
   // At the start of the function, find the CFA by adding wordsize to the SP
@@ -935,7 +935,7 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
   initial_regloc.SetAtCFAPlusOffset(-current_sp_bytes_offset_from_fa);
   row->SetRegisterInfo(m_lldb_ip_regnum, initial_regloc);
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
 
   // Allocate a new Row, populate it with the existing Row contents.
   UnwindPlan::Row *newrow = new UnwindPlan::Row;
@@ -1299,7 +1299,7 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
     if (row_updated) {
       if (current_func_text_offset + insn_len < size) {
         row->SetOffset(current_func_text_offset + insn_len);
-        unwind_plan.AppendRow(row);
+        unwind_plan.InsertRow(row);
         // Allocate a new Row, populate it with the existing Row contents.
         newrow = new UnwindPlan::Row;
         *newrow = *row.get();
@@ -1404,7 +1404,7 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
       UnwindPlan::RowSP new_row(new UnwindPlan::Row());
       *new_row = *original_last_row;
       new_row->SetOffset(offset);
-      unwind_plan.AppendRow(new_row);
+      unwind_plan.InsertRow(new_row);
       row = std::make_shared<UnwindPlan::Row>();
       *row = *new_row;
       reinstate_unwind_state = false;
@@ -1573,7 +1573,7 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
     }
   }
 
-  unwind_plan.SetPlanValidAddressRange(func_range);
+  unwind_plan.SetPlanValidAddressRanges({func_range});
   if (unwind_plan_updated) {
     std::string unwind_plan_source(unwind_plan.GetSourceName().AsCString());
     unwind_plan_source += " plus augmentation from assembly parsing";
diff --git a/lldb/source/Symbol/ArmUnwindInfo.cpp b/lldb/source/Symbol/ArmUnwindInfo.cpp
index 569e0f591cbaf..f7ff4c0210706 100644
--- a/lldb/source/Symbol/ArmUnwindInfo.cpp
+++ b/lldb/source/Symbol/ArmUnwindInfo.cpp
@@ -340,7 +340,7 @@ bool ArmUnwindInfo::GetUnwindPlan(Target &target, const Address &addr,
       row->SetRegisterLocationToRegister(dwarf_pc, dwarf_lr, false);
   }
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   unwind_plan.SetSourceName("ARM.exidx unwind info");
   unwind_plan.SetSourcedFromCompiler(eLazyBoolYes);
   unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
diff --git a/lldb/source/Symbol/CompactUnwindInfo.cpp b/lldb/source/Symbol/CompactUnwindInfo.cpp
index c9039ea51ff70..d9c0627cbb84c 100644
--- a/lldb/source/Symbol/CompactUnwindInfo.cpp
+++ b/lldb/source/Symbol/CompactUnwindInfo.cpp
@@ -206,7 +206,7 @@ bool CompactUnwindInfo::GetUnwindPlan(Target &target, Address addr,
                                   function_info.valid_range_offset_end -
                                       function_info.valid_range_offset_start,
                                   sl);
-          unwind_plan.SetPlanValidAddressRange(func_range);
+          unwind_plan.SetPlanValidAddressRanges({func_range});
         }
       }
 
@@ -786,7 +786,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
       saved_registers_offset--;
       saved_registers_locations >>= 3;
     }
-    unwind_plan.AppendRow(row);
+    unwind_plan.InsertRow(row);
     return true;
   } break;
 
@@ -954,7 +954,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
         }
       }
     }
-    unwind_plan.AppendRow(row);
+    unwind_plan.InsertRow(row);
     return true;
   } break;
 
@@ -1057,7 +1057,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
       saved_registers_offset--;
       saved_registers_locations >>= 3;
     }
-    unwind_plan.AppendRow(row);
+    unwind_plan.InsertRow(row);
     return true;
   } break;
 
@@ -1218,7 +1218,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
       }
     }
 
-    unwind_plan.AppendRow(row);
+    unwind_plan.InsertRow(row);
     return true;
   } break;
 
@@ -1336,7 +1336,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_arm64(Target &target,
     row->SetRegisterLocationToRegister(arm64_eh_regnum::pc, arm64_eh_regnum::ra,
                                        true);
 
-    unwind_plan.AppendRow(row);
+    unwind_plan.InsertRow(row);
     return true;
   }
 
@@ -1430,7 +1430,7 @@ bool CompactUnwindInfo::CreateUnwindPlan_arm64(Target &target,
     reg_pairs_saved_count++;
   }
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   return true;
 }
 
@@ -1606,6 +1606,6 @@ bool CompactUnwindInfo::CreateUnwindPlan_armv7(Target &target,
     }
   }
 
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
   return true;
 }
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
index a743de596b8d8..d968fbe7fc78a 100644
--- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
@@ -623,7 +623,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
   uint32_t code_align = cie->code_align;
   int32_t data_align = cie->data_align;
 
-  unwind_plan.SetPlanValidAddressRange(range);
+  unwind_plan.SetPlanValidAddressRanges({range});
   UnwindPlan::Row *cie_initial_row = new UnwindPlan::Row;
   *cie_initial_row = cie->initial_row;
   UnwindPlan::RowSP row(cie_initial_row);
@@ -650,7 +650,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
           // that is computed by taking the current entry's location value and
           // adding (delta * code_align). All other values in the new row are
           // initially identical to the current row.
-          unwind_plan.AppendRow(row);
+          unwind_plan.InsertRow(row);
           UnwindPlan::Row *newrow = new UnwindPlan::Row;
           *newrow = *row.get();
           row.reset(newrow);
@@ -690,7 +690,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
           // specified address as the location. All other values in the new row
           // are initially identical to the current row. The new location value
           // should always be greater than the current one.
-          unwind_plan.AppendRow(row);
+          unwind_plan.InsertRow(row);
           UnwindPlan::Row *newrow = new UnwindPlan::Row;
           *newrow = *row.get();
           row.reset(newrow);
@@ -704,7 +704,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
           // takes a single uword argument that represents a constant delta.
           // This instruction is identical to DW_CFA_advance_loc except for the
           // encoding and size of the delta argument.
-          unwind_plan.AppendRow(row);
+          unwind_plan.InsertRow(row);
           UnwindPlan::Row *newrow = new UnwindPlan::Row;
           *newrow = *row.get();
           row.reset(newrow);
@@ -717,7 +717,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
           // takes a single uword argument that represents a constant delta.
           // This instruction is identical to DW_CFA_advance_loc except for the
           // encoding and size of the delta argument.
-          unwind_plan.AppendRow(row);
+          unwind_plan.InsertRow(row);
           UnwindPlan::Row *newrow = new UnwindPlan::Row;
           *newrow = *row.get();
           row.reset(newrow);
@@ -730,7 +730,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
           // takes a single uword argument that represents a constant delta.
           // This instruction is identical to DW_CFA_advance_loc except for the
           // encoding and size of the delta argument.
-          unwind_plan.AppendRow(row);
+          unwind_plan.InsertRow(row);
           UnwindPlan::Row *newrow = new UnwindPlan::Row;
           *newrow = *row.get();
           row.reset(newrow);
@@ -812,7 +812,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
       }
     }
   }
-  unwind_plan.AppendRow(row);
+  unwind_plan.InsertRow(row);
 
   return true;
 }
diff --git a/lldb/source/Symbol/UnwindPlan.cpp b/lldb/source/Symbol/UnwindPlan.cpp
index 25e3676761436..f3621a2e123ed 100644
--- a/lldb/source/Symbol/UnwindPlan.cpp
+++ b/lldb/source/Symbol/UnwindPlan.cpp
@@ -389,78 +389,51 @@ bool UnwindPlan::Row::operator==(const UnwindPlan::Row &rhs) const {
          m_register_locations == rhs.m_register_locations;
 }
 
-void UnwindPlan::AppendRow(const UnwindPlan::RowSP &row_sp) {
-  if (m_row_list.empty() ||
-      m_row_list.back()->GetOffset() != row_sp->GetOffset())
-    m_row_list.push_back(row_sp);
-  else
-    m_row_list.back() = row_sp;
-}
-
 void UnwindPlan::InsertRow(const UnwindPlan::RowSP &row_sp,
                            bool replace_existing) {
-  collection::iterator it = m_row_list.begin();
-  while (it != m_row_list.end()) {
-    RowSP row = *it;
-    if (row->GetOffset() >= row_sp->GetOffset())
-      break;
-    it++;
-  }
-  if (it == m_row_list.end() || (*it)->GetOffset() != row_sp->GetOffset())
-    m_row_list.insert(it, row_sp);
-  else if (replace_existing)
-    *it = row_sp;
+  if (replace_existing)
+    m_rows.insert_or_assign(row_sp->GetOffset(), row_sp);
+  else
+    m_rows.emplace(row_sp->GetOffset(), row_sp);
 }
 
 UnwindPlan::RowSP UnwindPlan::GetRowForFunctionOffset(int offset) const {
-  RowSP row;
-  if (!m_row_list.empty()) {
-    if (offset == -1)
-      row = m_row_list.back();
-    else {
-      collection::const_iterator pos, end = m_row_list.end();
-      for (pos = m_row_list.begin(); pos != end; ++pos) {
-        if ((*pos)->GetOffset() <= static_cast<lldb::offset_t>(offset))
-          row = *pos;
-        else
-          break;
-      }
-    }
-  }
-  return row;
+  auto it = offset == -1 ? m_rows.end() : m_rows.upper_bound(offset);
+  if (it == m_rows.begin())
+    return nullptr;
+  // upper_bound returns the row strictly greater than our desired offset, which
+  // means that the row before it is a match.
+  return std::prev(it)->second;
 }
 
 bool UnwindPlan::IsValidRowIndex(uint32_t idx) const {
-  return idx < m_row_list.size();
+  return idx < m_rows.size();
 }
 
 const UnwindPlan::RowSP UnwindPlan::GetRowAtIndex(uint32_t idx) const {
-  if (idx < m_row_list.size())
-    return m_row_list[idx];
-  else {
-    Log *log = GetLog(LLDBLog::Unwind);
-    LLDB_LOGF(log,
-              "error: UnwindPlan::GetRowAtIndex(idx = %u) invalid index "
-              "(number rows is %u)",
-              idx, (uint32_t)m_row_list.size());
-    return UnwindPlan::RowSP();
-  }
+  if (idx < m_rows.size())
+    return std::next(m_rows.begin(), idx)->second;
+
+  LLDB_LOG(GetLog(LLDBLog::Unwind),
+           "error: UnwindPlan::GetRowAtIndex(idx = {0}) invalid index "
+           "(number rows is {1})",
+           idx, m_rows.size());
+  return nullptr;
 }
 
 const UnwindPlan::RowSP UnwindPlan::GetLastRow() const {
-  if (m_row_list.empty()) {
-    Log *log = GetLog(LLDBLog::Unwind);
-    LLDB_LOGF(log, "UnwindPlan::GetLastRow() when rows are empty");
-    return UnwindPlan::RowSP();
+  if (m_rows.empty()) {
+    LLDB_LOG(GetLog(LLDBLog::Unwind),
+             "UnwindPlan::GetLastRow() when rows are empty");
+    return nullptr;
   }
-  return m_row_list.back();
+  return m_rows.rbegin()->second;
 }
 
-int UnwindPlan::GetRowCount() const { return m_row_list.size(); }
+int UnwindPlan::GetRowCount() const { return m_rows.size(); }
 
-void UnwindPlan::SetPlanValidAddressRange(const AddressRange &range) {
-  if (range.GetBaseAddress().IsValid() && range.GetByteSize() != 0)
-    m_plan_valid_address_range = range;
+void UnwindPlan::SetPlanValidAddressRanges(std::vector<AddressRange> ranges) {
+  m_plan_valid_ranges = std::move(ranges);
 }
 
 bool UnwindPlan::PlanValidAtAddress(Address addr) {
@@ -486,9 +459,9 @@ bool UnwindPlan::PlanValidAtAddress(Address addr) {
   // If the 0th Row of unwind instructions is missing, or if it doesn't provide
   // a register to use to find the Canonical Frame Address, this is not a valid
   // UnwindPlan.
-  if (GetRowAtIndex(0).get() == nullptr ||
-      GetRowAtIndex(0)->GetCFAValue().GetValueType() ==
-          Row::FAValue::unspecified) {
+  RowSP row0_sp = GetRowForFunctionOffset(0);
+  if (!row0_sp ||
+      row0_sp->GetCFAValue().GetValueType() == Row::FAValue::unspecified) {
     Log *log = GetLog(LLDBLog::Unwind);
     if (log) {
       StreamString s;
@@ -507,17 +480,15 @@ bool UnwindPlan::PlanValidAtAddress(Address addr) {
     return false;
   }
 
-  if (!m_plan_valid_address_range.GetBaseAddress().IsValid() ||
-      m_plan_valid_address_range.GetByteSize() == 0)
+  if (m_plan_valid_ranges.empty())
     return true;
 
   if (!addr.IsValid())
     return true;
 
-  if (m_plan_valid_address_range.ContainsFileAddress(addr))
-    return true;
-
-  return false;
+  return llvm::any_of(m_plan_valid_ranges, [&](const AddressRange &range) {
+    return range.ContainsFileAddress(addr);
+  });
 }
 
 void UnwindPlan::Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const {
@@ -574,20 +545,17 @@ void UnwindPlan::Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const {
     s.Printf("not specified.\n");
     break;
   }
-  if (m_plan_valid_address_range.GetBaseAddress().IsValid() &&
-      m_plan_valid_address_range.GetByteSize() > 0) {
+  if (!m_plan_valid_ranges.empty()) {
     s.PutCString("Address range of this UnwindPlan: ");
     TargetSP target_sp(thread->CalculateTarget());
-    m_plan_valid_address_range.Dump(&s, target_sp.get(),
-                                    Address::DumpStyleSectionNameOffset);
+    for (const AddressRange &range : m_plan_valid_ranges)
+      range.Dump(&s, target_sp.get(), Address::DumpStyleSectionNameOffset);
     s.EOL();
   }
-  collection::const_iterator pos, begin = m_row_list.begin(),
-                                  end = m_row_list.end();
-  for (pos = begin; pos != end; ++pos) {
-    s.Printf("row[%u]: ", (uint32_t)std::distance(begin, pos));
-    (*pos)->Dump(s, this, thread, base_addr);
-    s.Printf("\n");
+  for (const auto &[index, kv] : llvm::enumerate(m_rows)) {
+    s.Format("row[{0}]: ", index);
+    kv.second->Dump(s, this, thread, base_addr);
+    s << "\n";
   }
 }
 
diff --git a/lldb/unittests/Symbol/CMakeLists.txt b/lldb/unittests/Symbol/CMakeLists.txt
index e1d24357e33db..4b0691205d3ea 100644
--- a/lldb/unittests/Symbol/CMakeLists.txt
+++ b/lldb/unittests/Symbol/CMakeLists.txt
@@ -11,6 +11,7 @@ add_lldb_unittest(SymbolTests
   TestDWARFCallFrameInfo.cpp
   TestType.cpp
   TestLineEntry.cpp
+  UnwindPlanTest.cpp
 
   LINK_LIBS
     lldbCore
diff --git a/lldb/unittests/Symbol/UnwindPlanTest.cpp b/lldb/unittests/Symbol/UnwindPlanTest.cpp
new file mode 100644
index 0000000000000..afbd9ab6ac38d
--- /dev/null
+++ b/lldb/unittests/Symbol/UnwindPlanTest.cpp
@@ -0,0 +1,76 @@
+//===-- UnwindPlanTest.cpp ------------------------------------------------===//
+//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Symbol/UnwindPlan.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+static UnwindPlan::RowSP make_simple_row(addr_t offset, uint64_t cfa_value) {
+  UnwindPlan::RowSP row_sp = std::make_shared<UnwindPlan::Row>();
+  row_sp->SetOffset(offset);
+  row_sp->GetCFAValue().SetIsConstant(cfa_value);
+  return row_sp;
+}
+
+TEST(UnwindPlan, InsertRow) {
+  UnwindPlan::RowSP row1_sp = make_simple_row(0, 42);
+  UnwindPlan::RowSP row2_sp = make_simple_row(0, 47);
+
+  UnwindPlan plan(eRegisterKindGeneric);
+  plan.InsertRow(row1_sp);
+  EXPECT_THAT(plan.GetRowForFunctionOffset(0), testing::Pointee(*row1_sp));
+
+  plan.InsertRow(row2_sp, /*replace_existing=*/false);
+  EXPECT_THAT(plan.GetRowForFunctionOffset(0), testing::Pointee(*row1_sp));
+
+  plan.InsertRow(row2_sp, /*replace_existing=*/true);
+  EXPECT_THAT(plan.GetRowForFunctionOffset(0), testing::Pointee(*row2_sp));
+}
+
+TEST(UnwindPlan, GetRowForFunctionOffset) {
+  UnwindPlan::RowSP row1_sp = make_simple_row(10, 42);
+  UnwindPlan::RowSP row2_sp = make_simple_row(20, 47);
+
+  UnwindPlan plan(eRegisterKindGeneric);
+  plan.InsertRow(row1_sp);
+  plan.InsertRow(row2_sp);
+
+  EXPECT_THAT(plan.GetRowForFunctionOffset(0), nullptr);
+  EXPECT_THAT(plan.GetRowForFunctionOffset(9), nullptr);
+  EXPECT_THAT(plan.GetRowForFunctionOffset(10), testing::Pointee(*row1_sp));
+  EXPECT_THAT(plan.GetRowForFunctionOffset(19), testing::Pointee(*row1_sp));
+  EXPECT_THAT(plan.GetRowForFunctionOffset(20), testing::Pointee(*row2_sp));
+  EXPECT_THAT(plan.GetRowForFunctionOffset(99), testing::Pointee(*row2_sp));
+}
+
+TEST(UnwindPlan, PlanValidAtAddress) {
+  UnwindPlan::RowSP row1_sp = make_simple_row(0, 42);
+  UnwindPlan::RowSP row2_sp = make_simple_row(10, 47);
+
+  UnwindPlan plan(eRegisterKindGeneric);
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(0)));
+
+  plan.InsertRow(row2_sp);
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(0)));
+
+  plan.InsertRow(row1_sp);
+  EXPECT_TRUE(plan.PlanValidAtAddress(Address(0)));
+  EXPECT_TRUE(plan.PlanValidAtAddress(Address(10)));
+
+  plan.SetPlanValidAddressRanges({AddressRange(0, 5), AddressRange(15, 5)});
+  EXPECT_TRUE(plan.PlanValidAtAddress(Address(0)));
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(5)));
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(10)));
+  EXPECT_TRUE(plan.PlanValidAtAddress(Address(15)));
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(20)));
+  EXPECT_FALSE(plan.PlanValidAtAddress(Address(25)));
+}
diff --git a/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp b/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp
index f5bb3b6d64236..d0c32feb8168e 100644
--- a/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp
+++ b/lldb/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp
@@ -2248,7 +2248,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSpArithx86_64Augmented) {
   sample_range = AddressRange(0x1000, sizeof(data));
 
   unwind_plan.SetSourceName("unit testing hand-created unwind plan");
-  unwind_plan.SetPlanValidAddressRange(sample_range);
+  unwind_plan.SetPlanValidAddressRanges({sample_range});
   unwind_plan.SetRegisterKind(eRegisterKindLLDB);
 
   row_sp = std::make_shared<UnwindPlan::Row>();
@@ -2260,7 +2260,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSpArithx86_64Augmented) {
   regloc.SetAtCFAPlusOffset(-8);
   row_sp->SetRegisterInfo(k_rip, regloc);
 
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   UnwindPlan::Row *new_row = new UnwindPlan::Row;
@@ -2272,7 +2272,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSpArithx86_64Augmented) {
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_rsp, 16);
   regloc.SetAtCFAPlusOffset(-16);
   row_sp->SetRegisterInfo(k_rbp, regloc);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   new_row = new UnwindPlan::Row;
@@ -2282,7 +2282,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSpArithx86_64Augmented) {
   // Describe offset 4
   row_sp->SetOffset(4);
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_rsp, 16);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   RegisterContextSP reg_ctx_sp;
   EXPECT_TRUE(engine64->AugmentUnwindPlanFromCallSite(
@@ -2335,7 +2335,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplex86_64Augmented) {
   sample_range = AddressRange(0x1000, sizeof(data));
 
   unwind_plan.SetSourceName("unit testing hand-created unwind plan");
-  unwind_plan.SetPlanValidAddressRange(sample_range);
+  unwind_plan.SetPlanValidAddressRanges({sample_range});
   unwind_plan.SetRegisterKind(eRegisterKindLLDB);
 
   row_sp = std::make_shared<UnwindPlan::Row>();
@@ -2347,7 +2347,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplex86_64Augmented) {
   regloc.SetAtCFAPlusOffset(-8);
   row_sp->SetRegisterInfo(k_rip, regloc);
 
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   UnwindPlan::Row *new_row = new UnwindPlan::Row;
@@ -2359,7 +2359,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplex86_64Augmented) {
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_rsp, 16);
   regloc.SetAtCFAPlusOffset(-16);
   row_sp->SetRegisterInfo(k_rbp, regloc);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   new_row = new UnwindPlan::Row;
@@ -2369,7 +2369,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplex86_64Augmented) {
   // Describe offset 4
   row_sp->SetOffset(4);
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_rbp, 16);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   RegisterContextSP reg_ctx_sp;
   EXPECT_TRUE(engine64->AugmentUnwindPlanFromCallSite(
@@ -2413,7 +2413,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplei386ugmented) {
   sample_range = AddressRange(0x1000, sizeof(data));
 
   unwind_plan.SetSourceName("unit testing hand-created unwind plan");
-  unwind_plan.SetPlanValidAddressRange(sample_range);
+  unwind_plan.SetPlanValidAddressRanges({sample_range});
   unwind_plan.SetRegisterKind(eRegisterKindLLDB);
 
   row_sp = std::make_shared<UnwindPlan::Row>();
@@ -2425,7 +2425,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplei386ugmented) {
   regloc.SetAtCFAPlusOffset(-4);
   row_sp->SetRegisterInfo(k_eip, regloc);
 
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   UnwindPlan::Row *new_row = new UnwindPlan::Row;
@@ -2437,7 +2437,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplei386ugmented) {
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_esp, 8);
   regloc.SetAtCFAPlusOffset(-8);
   row_sp->SetRegisterInfo(k_ebp, regloc);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   // Allocate a new Row, populate it with the existing Row contents.
   new_row = new UnwindPlan::Row;
@@ -2447,7 +2447,7 @@ TEST_F(Testx86AssemblyInspectionEngine, TestSimplei386ugmented) {
   // Describe offset 3
   row_sp->SetOffset(3);
   row_sp->GetCFAValue().SetIsRegisterPlusOffset(k_ebp, 8);
-  unwind_plan.AppendRow(row_sp);
+  unwind_plan.InsertRow(row_sp);
 
   RegisterContextSP reg_ctx_sp;
   EXPECT_TRUE(engine32->AugmentUnwindPlanFromCallSite(



More information about the lldb-commits mailing list