From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: gingold@adacore.com (Tristan Gingold)
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] solib for darwin
Date: Thu, 04 Dec 2008 15:39:00 -0000 [thread overview]
Message-ID: <200812041538.mB4FcQsB007133@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <32200CDA-AAC3-49CE-BD9C-AE51738DAAF1@adacore.com> from "Tristan Gingold" at Dec 03, 2008 01:53:58 PM
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
next prev parent reply other threads:[~2008-12-04 15:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-03 12:55 Tristan Gingold
2008-12-04 15:39 ` Ulrich Weigand [this message]
2008-12-04 16:01 ` Tristan Gingold
2008-12-11 13:12 ` Tristan Gingold
2008-12-14 17:40 ` Ulrich Weigand
2008-12-15 13:22 ` Tristan Gingold
2008-12-17 19:46 ` [rfc] Allow platform-specific override for solib_bfd_open (Re: [RFC] solib for darwin) Ulrich Weigand
2009-01-15 16:37 ` Ulrich Weigand
2009-01-15 16:53 ` Tristan Gingold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200812041538.mB4FcQsB007133@d12av02.megacenter.de.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=gingold@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox