[Lldb-commits] [lldb] r190642 - Fixed a bug where CFI data would become corrupted when using remember/restore state instructions.

Richard Mitton richard at codersnotes.com
Thu Sep 12 16:38:31 PDT 2013


Author: rmitton
Date: Thu Sep 12 18:38:30 2013
New Revision: 190642

URL: http://llvm.org/viewvc/llvm-project?rev=190642&view=rev
Log:
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.

Modified:
    lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp

Modified: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp?rev=190642&r1=190641&r2=190642&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Thu Sep 12 18:38:30 2013
@@ -444,6 +444,8 @@ DWARFCallFrameInfo::FDEToUnwindPlan (dw_
     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_
                         // 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_
                     // 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;
 





More information about the lldb-commits mailing list