From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [PATCH][gdb] Fix gdb.dwarf2/amd64-entry-value-param.exp with -fPIE/-pie
Date: Fri, 09 Aug 2019 18:16:00 -0000 [thread overview]
Message-ID: <87h86q4324.fsf@tromey.com> (raw)
In-Reply-To: <20190809075424.GA15972@delia> (Tom de Vries's message of "Fri, 9 Aug 2019 09:54:26 +0200")
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Fix this by eliminating baseaddr from read_call_site_scope, and handling the
Tom> relocation offset at the use sites in call_site_for_pc and
Tom> call_site_to_target_addr.
I like this approach, since it represents some small progress on the
objfile splitting project.
Tom> + {
Tom> + struct obj_section *sec;
Tom> + sec = find_pc_section (pc);
Tom> + if (sec != NULL)
Tom> + {
Tom> + struct objfile *objfile = sec->objfile;
Tom> + CORE_ADDR baseaddr
Tom> + = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
Why SECT_OFF_TEXT rather than the section "sec"?
Tom> + CORE_ADDR pc_unrelocated
Tom> + = gdbarch_adjust_dwarf2_addr (gdbarch, pc - baseaddr);
I am not sure gdbarch_adjust_dwarf2_addr can be used "bidirectionally"
like this. It is probably fine in practice but I wonder about the
documented contract.
Tom> + CORE_ADDR baseaddr
Tom> + = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
I guess this assumes the text section - but then can the call to
find_pc_section give anything else? Maybe it's just something to
comment and move on.
Tom> - pc = attr_value_as_address (attr) + baseaddr;
Tom> - pc = gdbarch_adjust_dwarf2_addr (gdbarch, pc);
Tom> + pc = attr_value_as_address (attr);
The approach taken elsewhere in dwarf2read.c is to bias, adjust, then
unbias:
CORE_ADDR low
= (gdbarch_adjust_dwarf2_addr (gdbarch, best_lowpc + baseaddr)
- baseaddr);
Maybe this would be better here as well, or at least consistent.
Tom
next prev parent reply other threads:[~2019-08-09 18:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-09 7:54 Tom de Vries
2019-08-09 8:33 ` Jan Kratochvil
2019-08-09 18:16 ` Tom Tromey [this message]
2019-08-12 13:10 ` Tom de Vries
2019-08-16 18:33 ` Pedro Alves
[not found] ` <ec0c10a4-ff73-4159-bce4-f1c702834d80@suse.de>
2019-09-02 11:08 ` [PING][PATCH][gdb] " Tom de Vries
2019-09-10 15:49 ` [PING^2][PATCH][gdb] " Tom de Vries
2019-09-13 19:45 ` Tom de Vries
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=87h86q4324.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=tdevries@suse.de \
/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