From: George Rimar Date: Mon, 16 Oct 2017 10:26:17 +0000 (+0000) Subject: [llvm-dwarfdump] - Teach tool to parse DW_CFA_GNU_args_size. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c5669aedb81dae0137a35af6250917084d3b08e;p=llvm [llvm-dwarfdump] - Teach tool to parse DW_CFA_GNU_args_size. Currently llvm-dwarfdump runs into llvm_unreachable when faces DW_CFA_GNU_args_size. Patch implements the support. Differential revision: https://reviews.llvm.org/D38879 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315897 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp index bceb0162b35..3312da67804 100644 --- a/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp +++ b/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp @@ -163,6 +163,7 @@ void FrameEntry::parseInstructions(DataExtractor Data, uint32_t *Offset, case DW_CFA_same_value: case DW_CFA_def_cfa_register: case DW_CFA_def_cfa_offset: + case DW_CFA_GNU_args_size: // Operands: ULEB128 addInstruction(Opcode, Data.getULEB128(Offset)); break; diff --git a/test/tools/llvm-dwarfdump/X86/debug_frame_GNU_args_size.s b/test/tools/llvm-dwarfdump/X86/debug_frame_GNU_args_size.s new file mode 100644 index 00000000000..b5d7cdee0e0 --- /dev/null +++ b/test/tools/llvm-dwarfdump/X86/debug_frame_GNU_args_size.s @@ -0,0 +1,15 @@ +# RUN: llvm-mc %s -filetype=obj -triple=i686-pc-linux -o %t +# RUN: llvm-dwarfdump -v %t | FileCheck %s + +# CHECK: .eh_frame contents: +# CHECK: 00000018 00000010 0000001c FDE cie=0000001c pc=00000000...00000000 +# CHECK-NEXT: DW_CFA_GNU_args_size: +16 +# CHECK-NEXT: DW_CFA_nop: + +.text +.globl foo +.type foo,@function +foo: + .cfi_startproc + .cfi_escape 0x2e, 0x10 + .cfi_endproc