public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two trivial DWARF reader changes
@ 2021-03-14 17:53 Tom Tromey
  2021-03-14 17:53 ` [pushed 1/2] Set dwarf2_per_cu_data::m_header_read_in Tom Tromey
  2021-03-14 17:53 ` [pushed 2/2] Minor tweak to use die_reader_specs::abfd Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Tromey @ 2021-03-14 17:53 UTC (permalink / raw)
  To: gdb-patches

I'm checking in these two trivial DWARF reader patches.  They both
came from an experiment I'm doing, and it seemed useful to push them
in.

Tested on x86-64 Fedora 32.

Tom



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pushed 1/2] Set dwarf2_per_cu_data::m_header_read_in
  2021-03-14 17:53 [PATCH 0/2] Two trivial DWARF reader changes Tom Tromey
@ 2021-03-14 17:53 ` Tom Tromey
  2021-03-14 17:53 ` [pushed 2/2] Minor tweak to use die_reader_specs::abfd Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2021-03-14 17:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I noticed that nothing in dwarf2/read.c sets
dwarf2_per_cu_data::m_header_read_in.  This patch adds the appropriate
assignment.

gdb/ChangeLog
2021-03-14  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.c (dwarf2_per_cu_data::get_header): Set
	m_header_read_in.
---
 gdb/ChangeLog     | 5 +++++
 gdb/dwarf2/read.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 3b72a96affe..dcf161fa359 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -24758,6 +24758,8 @@ dwarf2_per_cu_data::get_header () const
 
       read_comp_unit_head (&m_header, info_ptr, this->section,
 			   rcuh_kind::COMPILE);
+
+      m_header_read_in = true;
     }
 
   return &m_header;
-- 
2.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pushed 2/2] Minor tweak to use die_reader_specs::abfd
  2021-03-14 17:53 [PATCH 0/2] Two trivial DWARF reader changes Tom Tromey
  2021-03-14 17:53 ` [pushed 1/2] Set dwarf2_per_cu_data::m_header_read_in Tom Tromey
@ 2021-03-14 17:53 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2021-03-14 17:53 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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.
---
 gdb/ChangeLog     | 5 +++++
 gdb/dwarf2/read.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

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.26.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-14 17:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 17:53 [PATCH 0/2] Two trivial DWARF reader changes Tom Tromey
2021-03-14 17:53 ` [pushed 1/2] Set dwarf2_per_cu_data::m_header_read_in Tom Tromey
2021-03-14 17:53 ` [pushed 2/2] Minor tweak to use die_reader_specs::abfd Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).