This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc] New (!) BFD target
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 22 Oct 2003 22:41:05 -0400
- Subject: Re: [patch/rfc] New (!) BFD target
- References: <3F9725D2.3000102@redhat.com>
On Wed, Oct 22, 2003 at 08:50:26PM -0400, Andrew Cagney wrote:
> Hello,
>
> The attached adds a really simple BFD "target" and is used:
>
> bfd = bfd_open.. (...);
> targ = target_bfd_reopen (bfd)
> ... operation involving targ ...
> target_close (targ, 0);
>
> Looking at solib-svr4, this object makes it possible to change this:
>
> load_addr = read_pc () - tmp_bfd->start_address;
>
> into this:
>
> load_addr = (read_pc ()
> - gdbarch_convert_from_func_ptr_addr (current_gdbarch,
>
> bfd_get_start_address (tmp_bfd),
> tmp_bfd_target));
>
> i.e., pointer conversion is performed using the original executable and
> not the running program. Something needed to fix PPC64 needs.
>
> thoughts?
> I'll look to commit this in a few days,
I've already said my pieces about "xclose" and adding more mutable
members to the target_ops structure in separate messages, so I won't
repeat them. However, please explain more clearly why this is
necessary - you haven't provided enough context to understand.
Also, how does this interact with the "exec" target, whose
functionality it seems to duplicate in some ways? There should be an
exec target down the stack somewhere, why aren't you using that?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer