This is the mail archive of the gdb-patches@sourceware.org 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: [RFC] solib for darwin


Tristan Gingold wrote:

> solib.c:solib_bfd_open explicitly checked that the format is a  
> bfd_object.  As this might not be true
> on Darwin, I added a new solib target which does the check.  On  
> Darwin, it may also extract the right
> binary from the fat binary.
> 
> As it is not easy to retrieve the right member from a filename,  
> solib.c:symbol_add_stub calls
> symbol_file_add_from_bfd instead of symbol_file_add.  I think this is  
> still a good idea not to have
> 2 bfd for the same file.  But this also implies that the bfd must be  
> closed only once.  So I added a new
> flag, OBJF_KEEPBFD that prevent objfile.c from bfd_close-ing the bfd  
> of an objfile.

Interesting; I've been running into the same problem with supporting
SPU contexts as libraries in the context of the multi-architecture
Cell debugger.

However, instead of just overriding the bfd_check_format call (which
b.t.w. does a lot more than just checking the format, no matter its
name :-/), I've allowed the solib implementation to override the
whole solib_bfd_open call; this seems to provide more options for
future changes ...

I've been wondering about the two bfds as well; note that solib simply
mirrors what is being done for the main executable file (where we have
one bfd for the exec file and one for the symbol file).  With my
patch I've kept two bfds, but call the solib override implementation
to open each of them.

Maybe you can have a look at my patch:
http://sourceware.org/ml/gdb-patches/2008-09/msg00136.html
and see whether this would solve your problem as well (or if we can
come up with a joint approach to solve both problems).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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