From b0b299477cc7e538b2387ec05b92c7261bf31052 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 12 Apr 2022 15:36:16 -0400 Subject: [PATCH] gdb/dwarf: remove line_header::header_length field This can be a local in dwarf_decode_line_header. Change-Id: I2ecf4616d1a3197bd1e81ded9f999a2da9a685af --- gdb/dwarf2/line-header.c | 6 ++++-- gdb/dwarf2/line-header.h | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) 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 {}; -- 2.30.2