This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa:solib] Handle start-address descriptors
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Tue, 28 Oct 2003 14:55:15 -0700
- Subject: Re: [rfa:solib] Handle start-address descriptors
- References: <3F9D67D7.2090003@redhat.com>
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.)
> +/* 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?
/* 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.
> + return gdbarch_convert_from_func_ptr_addr (current_gdbarch,
> + bfd_get_start_address (abfd),
> + targ);
> +}
Kevin