From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [RFC 01/10] Remove baseaddr parameter from dwarf2_record_block_ranges
Date: Mon, 24 Apr 2023 10:22:02 -0600 [thread overview]
Message-ID: <20230424162211.682763-2-tromey@adacore.com> (raw)
In-Reply-To: <20230424162211.682763-1-tromey@adacore.com>
dwarf2_record_block_ranges is only ever called with the text section
offset, so this patch removes the parameter entirely. This makes a
subsequent patch a little simpler.
---
gdb/dwarf2/read.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 29a95cb8b2f..904dcc09405 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -904,7 +904,7 @@ static void get_scope_pc_bounds (struct die_info *,
struct dwarf2_cu *);
static void dwarf2_record_block_ranges (struct die_info *, struct block *,
- CORE_ADDR, struct dwarf2_cu *);
+ struct dwarf2_cu *);
static void dwarf2_add_field (struct field_info *, struct die_info *,
struct dwarf2_cu *);
@@ -6423,7 +6423,7 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language)
(such as virtual method tables). Record the ranges in STATIC_BLOCK's
addrmap to help ensure it has an accurate map of pc values belonging to
this comp unit. */
- dwarf2_record_block_ranges (cu->dies, static_block, baseaddr, cu);
+ dwarf2_record_block_ranges (cu->dies, static_block, cu);
cust = cu->get_builder ()->end_compunit_symtab_from_static_block
(static_block, 0);
@@ -10188,7 +10188,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
&objfile->objfile_obstack);
/* If we have address ranges, record them. */
- dwarf2_record_block_ranges (die, block, baseaddr, cu);
+ dwarf2_record_block_ranges (die, block, cu);
gdbarch_make_symbol_special (gdbarch, cstk.name, objfile);
@@ -10301,7 +10301,7 @@ read_lexical_block_scope (struct die_info *die, struct dwarf2_cu *cu)
there. But since we don't even decide whether to create a
block until after we've traversed its children, that's hard
to do. */
- dwarf2_record_block_ranges (die, block, baseaddr, cu);
+ dwarf2_record_block_ranges (die, block, cu);
}
*cu->get_builder ()->get_local_symbols () = cstk.locals;
cu->get_builder ()->set_local_using_directives (cstk.local_using_directives);
@@ -11278,9 +11278,10 @@ get_scope_pc_bounds (struct die_info *die,
static void
dwarf2_record_block_ranges (struct die_info *die, struct block *block,
- CORE_ADDR baseaddr, struct dwarf2_cu *cu)
+ struct dwarf2_cu *cu)
{
struct objfile *objfile = cu->per_objfile->objfile;
+ CORE_ADDR baseaddr = objfile->text_section_offset ();
struct gdbarch *gdbarch = objfile->arch ();
struct attribute *attr;
struct attribute *attr_high;
--
2.39.1
next prev parent reply other threads:[~2023-04-24 16:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-24 16:22 [RFC 00/10] More use of unrelocated_addr Tom Tromey
2023-04-24 16:22 ` Tom Tromey [this message]
2023-04-24 16:22 ` [RFC 02/10] Minor cleanup in loclist_describe_location Tom Tromey
2023-04-24 16:22 ` [RFC 03/10] Move unrelocated_addr to common-types.h Tom Tromey
2023-04-24 16:22 ` [RFC 04/10] Use unrelocated_addr in the DWARF reader Tom Tromey
2023-04-24 16:22 ` [RFC 05/10] Use unrelocated_addr in dwarf_decode_lines Tom Tromey
2023-04-24 16:22 ` [RFC 06/10] Fix comment in address_class Tom Tromey
2023-04-24 16:22 ` [RFC 07/10] Use "unrelocated" terminology in linetable_entry Tom Tromey
2023-04-24 16:22 ` [RFC 08/10] Constify dwarf2_cie::augmentation Tom Tromey
2023-04-24 16:22 ` [RFC 09/10] Use local "text offset" variable in dwarf2_frame_cache Tom Tromey
2023-04-24 16:22 ` [RFC 10/10] Use unrelocated_addr in dwarf2_fde Tom Tromey
2023-06-05 16:13 ` [RFC 00/10] More use of unrelocated_addr Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230424162211.682763-2-tromey@adacore.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).