Skip to content

Commit

Permalink
gdb/dwarf: remove line_header::header_length field
Browse files Browse the repository at this point in the history
This can be a local in dwarf_decode_line_header.

Change-Id: I2ecf4616d1a3197bd1e81ded9f999a2da9a685af
  • Loading branch information
simark committed Apr 21, 2022
1 parent ebf58f8 commit b0b2994
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions gdb/dwarf2/line-header.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion gdb/dwarf2/line-header.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down

0 comments on commit b0b2994

Please sign in to comment.