[patch/rfc] New (!) BFD target

Andrew Cagney cagney@gnu.org
Fri Oct 31 19:23:00 GMT 2003


> 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.

I've attached the updated patch which I've just committed.

Andrew

> 2003-10-22  Andrew Cagney  <cagney@redhat.com>
> 
> 	* target.h (struct target_ops): Add "to_data";
> 	* bfd-target.h, bfd-target.c: New files.
> 	* Makefile.in (SFILES): Add "bfd-target.c".
> 	(COMMON_OBS): Add "bfd-target.o".
> 	(bfd-target.o): Specify dependencies.
> 	(bfd_target_h): Define.
> 	* defs.h (XZALLOC): Define.
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031031/1d68fa6a/attachment.ksh>


More information about the Gdb-patches mailing list