Author: labath
Date: Wed Apr 22 04:47:21 2015
New Revision: 235493

URL: http://llvm.org/viewvc/llvm-project?rev=235493&view=rev
Log:
[DWARF CFI] Add support for DW_CFA_def_cfa_sf when parsing CIE

Summary: Just what it says on the box.

Reviewers: jasonmolenda

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9150

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=235493&r1=235492&r2=235493&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Wed Apr 22 04:47:21 2015
@@ -287,6 +287,19 @@ DWARFCallFrameInfo::ParseCIE (const dw_o
                 cie_sp->initial_row.GetCFAValue().SetIsRegisterPlusOffset 
(reg_num, op_offset);
                 continue;
             }
+            if (extended_opcode == DW_CFA_def_cfa_sf)
+            {
+                // The DW_CFA_def_cfa_sf instruction takes two operands: an 
unsigned LEB128 value
+                // representing a register number and a signed LEB128 factored 
offset. This
+                // instruction is identical to DW_CFA_def_cfa except that the 
second operand is
+                // signed and factored.
+                // The resulting offset is factored_offset * 
data_alignment_factor.
+                uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
+                int op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset);
+                cie_sp->initial_row.GetCFAValue().SetIsRegisterPlusOffset (
+                        reg_num, op_offset * cie_sp->data_align);
+                continue;
+            }
             if (primary_opcode == DW_CFA_offset)
             {   
                 // 0x80 - high 2 bits are 0x2, lower 6 bits are register.


_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to