This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rfc] New (!) BFD target


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]