summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-14 11:42:05 -0600
committerTom Tromey <tom@tromey.com>2021-03-14 11:50:06 -0600
commit0280fdcc0822f028d9889bb8c9559989bf71e69b (patch)
tree33548a1beb450f4ee37c37aee98a9eae75cb8c6a
parenta9f172c6b7a8f81e482568adecbea17860b5577c (diff)
downloadbinutils-gdb-0280fdcc0822f028d9889bb8c9559989bf71e69b.tar.gz
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 <tom@tromey.com> * dwarf2/read.c (struct die_reader_specs) <abfd>: Fix formatting. (peek_die_abbrev): Use reader.abfd.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2/read.c4
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,5 +1,10 @@
2021-03-14 Tom Tromey <tom@tromey.com>
+ * dwarf2/read.c (struct die_reader_specs) <abfd>: Fix formatting.
+ (peek_die_abbrev): Use reader.abfd.
+
+2021-03-14 Tom Tromey <tom@tromey.com>
+
* dwarf2/read.c (dwarf2_per_cu_data::get_header): Set
m_header_read_in.
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);