From 0280fdcc0822f028d9889bb8c9559989bf71e69b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 14 Mar 2021 11:42:05 -0600 Subject: [PATCH] Minor tweak to use die_reader_specs::abfd For an experiment I'm working on, it would be convenient if die_reader_specs::cu could be NULL. This is fairly involved to implement, but I did notice one spot that could conveniently be updated. While making this trivial change, I also noticed a small, related formatting error. 2021-03-14 Tom Tromey * dwarf2/read.c (struct die_reader_specs) : Fix formatting. (peek_die_abbrev): Use reader.abfd. --- gdb/ChangeLog | 5 +++++ gdb/dwarf2/read.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 387d2d54502..ad596d8626a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2021-03-14 Tom Tromey + + * dwarf2/read.c (struct die_reader_specs) : Fix formatting. + (peek_die_abbrev): Use reader.abfd. + 2021-03-14 Tom Tromey * dwarf2/read.c (dwarf2_per_cu_data::get_header): Set diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index dcf161fa359..f625a618a6d 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -955,7 +955,7 @@ struct dwp_file struct die_reader_specs { /* The bfd of die_section. */ - bfd* abfd; + bfd *abfd; /* The CU of the DIE we are parsing. */ struct dwarf2_cu *cu; @@ -8702,7 +8702,7 @@ peek_die_abbrev (const die_reader_specs &reader, const gdb_byte *info_ptr, unsigned int *bytes_read) { dwarf2_cu *cu = reader.cu; - bfd *abfd = cu->per_objfile->objfile->obfd; + bfd *abfd = reader.abfd; unsigned int abbrev_number = read_unsigned_leb128 (abfd, info_ptr, bytes_read); -- 2.30.2