[llvm] r316321 - [llvm-dwarfdump] - Teach tool about few GNU call_sites constants.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 23 04:24:14 PDT 2017
Author: grimar
Date: Mon Oct 23 04:24:14 2017
New Revision: 316321
URL: http://llvm.org/viewvc/llvm-project?rev=316321&view=rev
Log:
[llvm-dwarfdump] - Teach tool about few GNU call_sites constants.
This teaches tool about following consants:
DW_TAG_GNU_call_site,
DW_TAG_GNU_call_site_parameter,
DW_AT_GNU_call_site_value,
DW_AT_GNU_all_call_sites.
Constants documented here: https://sourceware.org/elfutils/DwarfExtensions
Differential revision: https://reviews.llvm.org/D39119
Added:
llvm/trunk/test/tools/llvm-dwarfdump/X86/gnu_call_site.s
Modified:
llvm/trunk/include/llvm/BinaryFormat/Dwarf.def
llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
Modified: llvm/trunk/include/llvm/BinaryFormat/Dwarf.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BinaryFormat/Dwarf.def?rev=316321&r1=316320&r2=316321&view=diff
==============================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Dwarf.def (original)
+++ llvm/trunk/include/llvm/BinaryFormat/Dwarf.def Mon Oct 23 04:24:14 2017
@@ -176,6 +176,8 @@ HANDLE_DW_TAG(0x4103, class_template, 0,
HANDLE_DW_TAG(0x4106, GNU_template_template_param, 0, GNU)
HANDLE_DW_TAG(0x4107, GNU_template_parameter_pack, 0, GNU)
HANDLE_DW_TAG(0x4108, GNU_formal_parameter_pack, 0, GNU)
+HANDLE_DW_TAG(0x4109, GNU_call_site, 0, GNU)
+HANDLE_DW_TAG(0x410a, GNU_call_site_parameter, 0, GNU)
HANDLE_DW_TAG(0x4200, APPLE_property, 0, APPLE)
HANDLE_DW_TAG(0xb000, BORLAND_property, 0, BORLAND)
HANDLE_DW_TAG(0xb001, BORLAND_Delphi_string, 0, BORLAND)
@@ -338,6 +340,8 @@ HANDLE_DW_AT(0x2106, body_end, 0, GNU)
HANDLE_DW_AT(0x2107, GNU_vector, 0, GNU)
HANDLE_DW_AT(0x2110, GNU_template_name, 0, GNU)
HANDLE_DW_AT(0x210f, GNU_odr_signature, 0, GNU)
+HANDLE_DW_AT(0x2111, GNU_call_site_value, 0, GNU)
+HANDLE_DW_AT(0x2117, GNU_all_call_sites, 0, GNU)
HANDLE_DW_AT(0x2119, GNU_macros, 0, GNU)
// Extensions for Fission proposal.
HANDLE_DW_AT(0x2130, GNU_dwo_name, 0, GNU)
Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp?rev=316321&r1=316320&r2=316321&view=diff
==============================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp (original)
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp Mon Oct 23 04:24:14 2017
@@ -234,7 +234,8 @@ static void dumpAttribute(raw_ostream &O
else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line)
OS << *formValue.getAsUnsignedConstant();
else if (Attr == DW_AT_location || Attr == DW_AT_frame_base ||
- Attr == DW_AT_data_member_location)
+ Attr == DW_AT_data_member_location ||
+ Attr == DW_AT_GNU_call_site_value)
dumpLocation(OS, formValue, U, sizeof(BaseIndent) + Indent + 4, DumpOpts);
else
formValue.dump(OS, DumpOpts);
Added: llvm/trunk/test/tools/llvm-dwarfdump/X86/gnu_call_site.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-dwarfdump/X86/gnu_call_site.s?rev=316321&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-dwarfdump/X86/gnu_call_site.s (added)
+++ llvm/trunk/test/tools/llvm-dwarfdump/X86/gnu_call_site.s Mon Oct 23 04:24:14 2017
@@ -0,0 +1,118 @@
+# RUN: llvm-mc %s -filetype obj -triple i686-pc-linux -o %t
+# RUN: llvm-dwarfdump %t | FileCheck %s
+
+# CHECK: DW_TAG_subprogram
+# CHECK-NEXT: DW_AT_external (true)
+# CHECK-NEXT: DW_AT_name ("fn4")
+# CHECK-NEXT: DW_AT_linkage_name ()
+# CHECK-NEXT: DW_AT_low_pc (0x0000000000000000)
+# CHECK-NEXT: DW_AT_high_pc (0x00000000)
+# CHECK-NEXT: DW_AT_frame_base (DW_OP_call_frame_cfa)
+# CHECK-NEXT: DW_AT_GNU_all_call_sites (true)
+
+# CHECK: DW_TAG_GNU_call_site
+# CHECK-NEXT: DW_AT_low_pc (0x0000000000000000)
+# CHECK-NEXT: DW_AT_abstract_origin (cu + 0x0001)
+
+# CHECK: DW_TAG_GNU_call_site_parameter
+# CHECK-NEXT: DW_AT_location (DW_OP_reg0 EAX)
+# CHECK-NEXT: DW_AT_GNU_call_site_value (DW_OP_addr 0x0)
+
+.section .debug_info,"", at progbits
+ .long 0x47
+ .value 0x4
+ .long 0
+ .byte 0x4
+
+ .uleb128 0x1 # DW_TAG_compile_unit [1]
+ .long 0
+ .byte 0x0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+
+ .uleb128 0xe # DW_TAG_subprogram [14]
+ .string "fn4"
+ .long 0
+ .long 0
+ .long 0
+ .uleb128 0x1 # DW_AT_GNU_all_call_sites
+ .byte 0x9c
+
+ .uleb128 0x12 # DW_TAG_GNU_call_site [18]
+ .long 0x0
+ .long 0x1
+
+ .uleb128 0x13 # DW_TAG_GNU_call_site_parameter [19]
+ .uleb128 0x1
+ .byte 0x50
+ .uleb128 0x5
+ .byte 0x3
+ .long X
+ .byte 0
+ .byte 0
+ .byte 0
+
+.section .debug_abbrev,"", at progbits
+ .uleb128 0x1
+ .uleb128 0x11
+ .byte 0x1 # [1]
+ .uleb128 0x25
+ .uleb128 0xe
+ .uleb128 0x13
+ .uleb128 0xb
+ .uleb128 0x3
+ .uleb128 0xe
+ .uleb128 0x1b
+ .uleb128 0xe
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x12
+ .uleb128 0x6
+ .uleb128 0x10
+ .uleb128 0x17
+ .byte 0
+ .byte 0
+
+ .uleb128 0xe # [14]
+ .uleb128 0x2e
+ .byte 0x1
+ .uleb128 0x3f
+ .uleb128 0x19
+ .uleb128 0x3
+ .uleb128 0x8
+ .uleb128 0x6e
+ .uleb128 0xe
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x12
+ .uleb128 0x6
+ .uleb128 0x40
+ .uleb128 0x18
+ .uleb128 0x2117
+ .uleb128 0x19
+ .byte 0
+ .byte 0
+
+ .uleb128 0x12 # [18]
+ .uleb128 0x4109
+ .byte 0x1
+ .uleb128 0x11
+ .uleb128 0x1
+ .uleb128 0x31
+ .uleb128 0x13
+ .byte 0
+ .byte 0
+
+ .uleb128 0x13 # [19]
+ .uleb128 0x410a
+ .byte 0
+ .uleb128 0x2
+ .uleb128 0x18
+ .uleb128 0x2111
+ .uleb128 0x18
+ .byte 0
+ .byte 0
+ .byte 0
More information about the llvm-commits
mailing list