DWARF5 .debug_info headers, .debug_types -> .debug_info DW_UT_type
diff mbox

Message ID 20161030193147.GA6778@host1.jankratochvil.net
State New
Headers show

Commit Message

Jan Kratochvil Oct. 30, 2016, 7:31 p.m. UTC
On Fri, 21 Oct 2016 21:32:42 +0200, Jakub Jelinek wrote:
> This patch changes the .debug_info headers to follow the current
> specification (I still hope the useless padding1/padding2 fields will be
> removed), and also changes the -gsplit-dwarf stuff to move dwo_id into
> the header and use DW_UT_{skeleton,split_*}.

During GDB consumer patch testing I needed this fix on top of your patch.


Jan

Patch
diff mbox

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7c6a9e9..1c0ca35 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2977,7 +2977,8 @@  skeleton_chain_node;
 
 /* Fixed size portion of the DWARF compilation unit header.  */
 #define DWARF_COMPILE_UNIT_HEADER_SIZE \
-  (DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE + 3)
+  (DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE \
+   + (dwarf_version < 5 ? 3 : 4 + 8 + DWARF_OFFSET_SIZE))
 
 /* Fixed size portion of the DWARF comdat type unit header.  */
 #define DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE \