summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Mitton <richard@codersnotes.com>2013-09-12 23:38:30 +0000
committerRichard Mitton <richard@codersnotes.com>2013-09-12 23:38:30 +0000
commitf70d60404dd8f3fc428daeb0e0c24f1613282020 (patch)
tree9b469bf1886fe0f48f4daf9209b3f1f1ff1731f9
parent3141d605b939019aa23722b48563ac9ac16dcda7 (diff)
downloadbcm5719-llvm-f70d60404dd8f3fc428daeb0e0c24f1613282020.tar.gz
bcm5719-llvm-f70d60404dd8f3fc428daeb0e0c24f1613282020.zip
Fixed a bug where CFI data would become corrupted when using remember/restore state instructions.
This would prevent system calls on Linux from being able to backtrace correctly. llvm-svn: 190642
-rw-r--r--lldb/source/Symbol/DWARFCallFrameInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
index 5caf8007485..d3d96289669 100644
--- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
@@ -444,6 +444,8 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
unwind_plan.SetRegisterKind (m_reg_kind);
unwind_plan.SetReturnAddressRegister (cie->return_addr_reg_num);
+ std::vector<UnwindPlan::RowSP> stack;
+
UnwindPlan::Row::RegisterLocation reg_location;
while (m_cfi_data.ValidOffset(offset) && offset < end_offset)
{
@@ -629,7 +631,7 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
// function.)
- unwind_plan.AppendRow (row);
+ stack.push_back (row);
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *row.get();
row.reset (newrow);
@@ -645,7 +647,8 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr
// useful for compilers that move epilogue code into the body of a
// function.)
{
- row = unwind_plan.GetRowAtIndex(unwind_plan.GetRowCount() - 1);
+ row = stack.back ();
+ stack.pop_back ();
}
break;
OpenPOWER on IntegriCloud