summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2012-07-14 04:52:53 +0000
committerJason Molenda <jmolenda@apple.com>2012-07-14 04:52:53 +0000
commit1d42c7bc3214818781b232428f09d679d4906342 (patch)
tree77c395a5298096db77c4007ef353a2f0052ecf75 /lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
parent64e1d4abc71a40f6dfad61b03932d16f917ffcb6 (diff)
downloadbcm5719-llvm-1d42c7bc3214818781b232428f09d679d4906342.tar.gz
bcm5719-llvm-1d42c7bc3214818781b232428f09d679d4906342.zip
Switch nearly all of the use of the UnwindPlan::Row's to go through
a shared pointer to ease some memory management issues with a patch I'm working on. The main complication with using SPs for these objects is that most methods that build up an UnwindPlan will construct a Row to a given instruction point in a function, then add additional regsaves in the next instruction point to that row and push it again. A little care is needed to not mutate the previous instruction point's Row once these are switched to being held behing shared pointers. llvm-svn: 160214
Diffstat (limited to 'lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp')
-rw-r--r--lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
index d3b82b2d352..384c7eea786 100644
--- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
+++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
@@ -536,13 +536,13 @@ ABIMacOSX_arm::CreateFunctionEntryUnwindPlan (UnwindPlan &unwind_plan)
pc_reg_num == LLDB_INVALID_REGNUM)
return false;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
// Our Call Frame Address is the stack pointer value
- row.SetCFARegister (sp_reg_num);
+ row->SetCFARegister (sp_reg_num);
// The previous PC is in the LR
- row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
+ row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
unwind_plan.AppendRow (row);
// All other registers are the same.
@@ -557,17 +557,17 @@ ABIMacOSX_arm::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)
uint32_t fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11;
uint32_t pc_reg_num = dwarf_pc;
- UnwindPlan::Row row;
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
const int32_t ptr_size = 4;
unwind_plan.Clear ();
unwind_plan.SetRegisterKind (eRegisterKindDWARF);
- row.SetCFARegister (fp_reg_num);
- row.SetCFAOffset (2 * ptr_size);
- row.SetOffset (0);
+ row->SetCFARegister (fp_reg_num);
+ row->SetCFAOffset (2 * ptr_size);
+ row->SetOffset (0);
- row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
- row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
unwind_plan.AppendRow (row);
unwind_plan.SetSourceName ("arm-apple-ios default unwind plan");
OpenPOWER on IntegriCloud