This revision was automatically updated to reflect the committed changes. Closed by commit rL275260: Add "support" for DW_CFA_GNU_args_size to the unwinder (authored by labath).
Changed prior to commit: http://reviews.llvm.org/D22266?vs=63678&id=63792#toc Repository: rL LLVM http://reviews.llvm.org/D22266 Files: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp Index: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp =================================================================== --- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp +++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp @@ -408,6 +408,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr, UnwindPlan& unwind_plan) { + Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND); lldb::offset_t offset = dwarf_offset; lldb::offset_t current_entry = offset; @@ -648,13 +649,32 @@ // 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.) + if (stack.empty()) + { + if (log) + log->Printf( + "DWARFCallFrameInfo::%s(dwarf_offset: %" PRIx32 ", startaddr: %" PRIx64 + " encountered DW_CFA_restore_state but state stack is empty. Corrupt unwind info?", + __FUNCTION__, dwarf_offset, startaddr.GetFileAddress()); + break; + } lldb::addr_t offset = row->GetOffset (); row = stack.back (); stack.pop_back (); row->SetOffset (offset); break; } + case DW_CFA_GNU_args_size: // 0x2e + { + // The DW_CFA_GNU_args_size instruction takes an unsigned LEB128 operand + // representing an argument size. This instruction specifies the total of + // the size of the arguments which have been pushed onto the stack. + + // TODO: Figure out how we should handle this. + m_cfi_data.GetULEB128(&offset); + } + case DW_CFA_val_offset : // 0x14 case DW_CFA_val_offset_sf : // 0x15 default:
Index: lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp =================================================================== --- lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp +++ lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp @@ -408,6 +408,7 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan (dw_offset_t dwarf_offset, Address startaddr, UnwindPlan& unwind_plan) { + Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND); lldb::offset_t offset = dwarf_offset; lldb::offset_t current_entry = offset; @@ -648,13 +649,32 @@ // 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.) + if (stack.empty()) + { + if (log) + log->Printf( + "DWARFCallFrameInfo::%s(dwarf_offset: %" PRIx32 ", startaddr: %" PRIx64 + " encountered DW_CFA_restore_state but state stack is empty. Corrupt unwind info?", + __FUNCTION__, dwarf_offset, startaddr.GetFileAddress()); + break; + } lldb::addr_t offset = row->GetOffset (); row = stack.back (); stack.pop_back (); row->SetOffset (offset); break; } + case DW_CFA_GNU_args_size: // 0x2e + { + // The DW_CFA_GNU_args_size instruction takes an unsigned LEB128 operand + // representing an argument size. This instruction specifies the total of + // the size of the arguments which have been pushed onto the stack. + + // TODO: Figure out how we should handle this. + m_cfi_data.GetULEB128(&offset); + } + case DW_CFA_val_offset : // 0x14 case DW_CFA_val_offset_sf : // 0x15 default:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits