From: Andrew Cagney <ac131313@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa:solib] Handle start-address descriptors
Date: Tue, 28 Oct 2003 23:50:00 -0000 [thread overview]
Message-ID: <3F9DAF09.6010003@redhat.com> (raw)
In-Reply-To: <1031028215515.ZM3717@localhost.localdomain>
> On Oct 27, 1:45pm, Andrew Cagney wrote:
>
>
>> Index: solib-svr4.c
>
> ...
>
>> +#include "bfd-target.h"
>> +#include "exec.h"
>
>
> I'm surprised that you needed to include exec.h. solib-svr4.c already
> includes target.h and I would've thought this to be sufficient. If
> exec.h isn't needed, please take it out. (Don't forget to fix Makefile.in.)
They are both needed.
>> +/* Given an executable's ABFD and target, compute the entry-point
>> + address. */
>> +
>> +static CORE_ADDR
>> +exec_entry_point (struct bfd *abfd, struct target_ops *targ)
>> +{
>
>
> Could you add a comment here telling why
> gdbarch_convert_from_func_ptr_addr() is needed. Maybe something like
> this?
I'll add your comment.
> /* For most targets, the address returned by bfd_get_start_address()
> is the entry point for the start function. But, for some targets,
> bfd_get_start_address() returns the address of a function descriptor
> from which the entry point address may be extracted. This address
> is extracted by gdbarch_convert_from_func_ptr_addr(). The method
> gdbarch_convert_from_func_ptr_addr() is the merely the identify
> function for targets which don't use function descriptors. */
>
> Hmm, a possible problem... What happens when the target uses function
> descriptors, but not for the exec file's start address? I'm wondering
> (ugh) if a separate gdbarch method is required for obtaining the start
> address.
Fortunatly a previous patch addressed that problem. The convert
function is only applied to positively identified descriptors.
>> + return gdbarch_convert_from_func_ptr_addr (current_gdbarch,
>> + bfd_get_start_address (abfd),
>> + targ);
>> +}
Andrew
next prev parent reply other threads:[~2003-10-28 23:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-27 18:45 Andrew Cagney
2003-10-27 18:57 ` Kevin Buettner
2003-10-27 19:11 ` Andrew Cagney
2003-10-28 21:55 ` Kevin Buettner
2003-10-28 23:50 ` Andrew Cagney [this message]
2003-10-29 4:21 ` Kevin Buettner
2003-10-29 15:47 ` Andrew Cagney
2003-10-31 21:15 ` Andrew Cagney
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=3F9DAF09.6010003@redhat.com \
--to=ac131313@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@redhat.com \
/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