]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
readelf: Show Unit Type for DWARF5
authorMark Wielaard <mark@klomp.org>
Wed, 23 Sep 2020 14:48:35 +0000 (16:48 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 16 Nov 2020 19:41:54 +0000 (20:41 +0100)
binutils/ChangeLog:

* dwarf.c (process_debug_info): Print Unit Type for DWARF5.
* testsuite/binutils-all/dw5.W: Adjust expected output.
* testsuite/binutils-all/dwarf-attributes.W: Likewise.

gas/ChangeLog:

* testsuite/gas/elf/dwarf-5-cu.d: Adjust expected output.

(cherry picked from commit debd1a62c4d250a6257e9018d9f9c7355edcdf8b)

binutils/ChangeLog
binutils/dwarf.c
binutils/testsuite/binutils-all/dw5.W
binutils/testsuite/binutils-all/dwarf-attributes.W
gas/ChangeLog
gas/testsuite/gas/elf/dwarf-5-cu.d

index 255fe9510a59dfc0628a48119495802e06b5aa92..5e048dbf34726df50a88bb677a8cc3cff6337e02 100644 (file)
@@ -1,3 +1,12 @@
+2020-11-15  Mark Wielaard  <mark@klomp.org>
+
+       Backport from the mainline:
+       2020-09-23  Mark Wielaard  <mark@klomp.org>
+
+       * dwarf.c (process_debug_info): Print Unit Type for DWARF5.
+       * testsuite/binutils-all/dw5.W: Adjust expected output.
+       * testsuite/binutils-all/dwarf-attributes.W: Likewise.
+
 2020-11-15  Mark Wielaard  <mark@klomp.org>
 
        Backport from the mainline:
index ca6758cd0db9380d68fba1e050a4b187effd85ef..b163c5b64f363ed831fcca62a63d70024f6fd815 100644 (file)
@@ -3361,6 +3361,10 @@ process_debug_info (struct dwarf_section *           section,
                  dwarf_vmatoa ("x", compunit.cu_length),
                  offset_size == 8 ? "64-bit" : "32-bit");
          printf (_("   Version:       %d\n"), compunit.cu_version);
+         if (compunit.cu_version >= 5)
+           printf (_("   Unit Type:     %s (%x)\n"),
+                   get_DW_UT_name (compunit.cu_unit_type) ?: "???",
+                   compunit.cu_unit_type);
          printf (_("   Abbrev Offset: 0x%s\n"),
                  dwarf_vmatoa ("x", compunit.cu_abbrev_offset));
          printf (_("   Pointer Size:  %d\n"), compunit.cu_pointer_size);
index 2eccb03c5a60a0f637ff1ce6b528bce65df450d6..cb949ad49cdfff9fc8ff42f534e6f91de1af9358 100644 (file)
@@ -3,6 +3,7 @@ Contents of the .debug_info section:
   Compilation Unit @ offset 0x0:
    Length:        0x160 \(32-bit\)
    Version:       5
+   Unit Type:     DW_UT_compile \(1\)
    Abbrev Offset: 0x0
    Pointer Size:  8
  <0><c>: Abbrev Number: 6 \(DW_TAG_compile_unit\)
index 3a4e7409889a91f9fc7a5b77b0581bc54dc75ee7..4e8386ae8807a7b10eb088903245a0e85243c8a6 100644 (file)
@@ -3,6 +3,7 @@ Contents of the .debug_info section:
   Compilation Unit @ offset 0x0:
    Length:        0x40 \(32-bit\)
    Version:       5
+   Unit Type:     DW_UT_compile \(1\)
    Abbrev Offset: 0x0
    Pointer Size:  4
  <0><c>: Abbrev Number: 1 \(User TAG value: 0x5555\)
index 417923ca1142a30a4ae09e54d32dc83a13090df1..377fbf752eeb0002f4b2b0057f5720ead21c7197 100644 (file)
@@ -1,3 +1,10 @@
+2020-11-15  Mark Wielaard  <mark@klomp.org>
+
+       Backport from the mainline:
+       2020-09-23  Mark Wielaard  <mark@klomp.org>
+
+       * testsuite/gas/elf/dwarf-5-cu.d: Adjust expected output.
+
 2020-11-05  Alex Coplan  <alex.coplan@arm.com>
 
        * config/tc-aarch64.c (aarch64_cpus): Add neoverse-n2.
index 839b4b7c77b46705bea0b9dde8c9a09f836f4166..7db20a330b86c2ebcbeeef2502188abea1b4d9f9 100644 (file)
@@ -6,6 +6,7 @@
   Compilation Unit @ offset 0x0:
    Length:        0x.*
    Version:       5
+   Unit Type:     DW_UT_compile \(1\)
    Abbrev Offset: 0x0
    Pointer Size:  .
 #pass