aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/comp-unit-head.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-07-15 19:05:29 -0600
committerTom Tromey <tom@tromey.com>2022-12-26 11:01:10 -0700
commit4d78ce772370fa48b9a749f81205076f26eba846 (patch)
treea26f1109b9cf24c35a21beaa4a02baee61bb04e1 /gdb/dwarf2/comp-unit-head.h
parent639601f90d1fda494e1d9c17b7f71d31e3b0a5e3 (diff)
downloadfsf-binutils-gdb-4d78ce772370fa48b9a749f81205076f26eba846.zip
fsf-binutils-gdb-4d78ce772370fa48b9a749f81205076f26eba846.tar.gz
fsf-binutils-gdb-4d78ce772370fa48b9a749f81205076f26eba846.tar.bz2
Add initializers to comp_unit_head
PR symtab/29343 points out that it would be beneficial if comp_unit_head had a constructor and used initializers. This patch implements this. I'm unsure if this is sufficient to close the bug, but at least it's a step. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29343
Diffstat (limited to 'gdb/dwarf2/comp-unit-head.h')
-rw-r--r--gdb/dwarf2/comp-unit-head.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/dwarf2/comp-unit-head.h b/gdb/dwarf2/comp-unit-head.h
index a7ee3e6..7579fe7 100644
--- a/gdb/dwarf2/comp-unit-head.h
+++ b/gdb/dwarf2/comp-unit-head.h
@@ -34,36 +34,36 @@
translation, looks like this. */
struct comp_unit_head
{
- unsigned int length;
- unsigned char version;
- unsigned char addr_size;
- unsigned char signed_addr_p;
- sect_offset abbrev_sect_off;
+ unsigned int length = 0;
+ unsigned char version = 0;
+ unsigned char addr_size = 0;
+ unsigned char signed_addr_p = 0;
+ sect_offset abbrev_sect_off {};
/* Size of file offsets; either 4 or 8. */
- unsigned int offset_size;
+ unsigned int offset_size = 0;
/* Size of the length field; either 4 or 12. */
- unsigned int initial_length_size;
+ unsigned int initial_length_size = 0;
- enum dwarf_unit_type unit_type;
+ enum dwarf_unit_type unit_type {};
/* Offset to first die in this cu from the start of the cu.
This will be the first byte following the compilation unit header. */
- cu_offset first_die_cu_offset;
+ cu_offset first_die_cu_offset {};
/* Offset to the first byte of this compilation unit header in the
.debug_info section, for resolving relative reference dies. */
- sect_offset sect_off;
+ sect_offset sect_off {};
/* For types, offset in the type's DIE of the type defined by this TU. */
- cu_offset type_cu_offset_in_tu;
+ cu_offset type_cu_offset_in_tu {};
/* 64-bit signature of this unit. For type units, it denotes the signature of
the type (DW_UT_type in DWARF 4, additionally DW_UT_split_type in DWARF 5).
Also used in DWARF 5, to denote the dwo id when the unit type is
DW_UT_skeleton or DW_UT_split_compile. */
- ULONGEST signature;
+ ULONGEST signature = 0;
/* Return the total length of the CU described by this header. */
unsigned int get_length () const