From: Simon Marchi Date: Tue, 12 Apr 2022 19:36:16 +0000 (-0400) Subject: gdb/dwarf: remove line_header::header_length field X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0b299477cc7e538b2387ec05b92c7261bf31052;p=binutils-gdb.git gdb/dwarf: remove line_header::header_length field This can be a local in dwarf_decode_line_header. Change-Id: I2ecf4616d1a3197bd1e81ded9f999a2da9a685af --- diff --git a/gdb/dwarf2/line-header.c b/gdb/dwarf2/line-header.c index 9a5f3fabe8d..63230847568 100644 --- a/gdb/dwarf2/line-header.c +++ b/gdb/dwarf2/line-header.c @@ -329,11 +329,13 @@ dwarf_decode_line_header (sect_offset sect_off, bool is_dwz, return NULL; } } - lh->header_length = read_offset (abfd, line_ptr, offset_size); + + LONGEST header_length = read_offset (abfd, line_ptr, offset_size); line_ptr += offset_size; - lh->statement_program_start = line_ptr + lh->header_length; + lh->statement_program_start = line_ptr + header_length; lh->minimum_instruction_length = read_1_byte (abfd, line_ptr); line_ptr += 1; + if (lh->version >= 4) { lh->maximum_ops_per_instruction = read_1_byte (abfd, line_ptr); diff --git a/gdb/dwarf2/line-header.h b/gdb/dwarf2/line-header.h index 25b9e7c2032..59b317d0d72 100644 --- a/gdb/dwarf2/line-header.h +++ b/gdb/dwarf2/line-header.h @@ -137,7 +137,6 @@ struct line_header unsigned offset_in_dwz : 1; /* Can't initialize bitfields in-class. */ unsigned short version {}; - unsigned int header_length {}; unsigned char minimum_instruction_length {}; unsigned char maximum_ops_per_instruction {}; unsigned char default_is_stmt {};