From: Reid Kleckner <rnk@google.com>
To: uweigand@de.ibm.com
Cc: tromey@redhat.com, Reid Kleckner <rnk@mit.edu>,
gdb-patches@sourceware.org,
unladen-swallow@googlegroups.com
Subject: Re: [unladen-swallow] Re: [RFA] Add interface for registering JITed code
Date: Sat, 25 Jul 2009 00:40:00 -0000 [thread overview]
Message-ID: <25eb677d0907241655q11ca995dgd549b6a156f4de3c@mail.gmail.com> (raw)
In-Reply-To: <200907241130.n6OBUwMe004564@d12av02.megacenter.de.ibm.com>
On Fri, Jul 24, 2009 at 4:30 AM, Ulrich Weigand<uweigand@de.ibm.com> wrote:
>> Reid> + /* Hack to work around the fact that BFD does not take ownership of the
>> Reid> + memory for files allocated in memory. */
>>
>> Is it possible to fix this directly in BFD? Since...
>>
>> Reid> + bim = (struct bfd_in_memory *) objfile->obfd->iostream;
>>
>> ... this is definitely fishy :-)
>
> I'd suggest that Reid instead use bfd_openr_iovec to access an ELF image
> directly in inferior memory, as is currently done e.g. by
> remote.c:remote_bfd_open
> spu-linux-nat.c:spu_bfd_open
> solib-spu.c:spu_bfd_open (is about to be introduced by the patch
> http://sourceware.org/ml/gdb-patches/2009-07/msg00546.html)
> This works without BFD changes or directly accessing BFD internals ...
I implemented this in the last patch I sent out. It was a lot of fun.
It turns out you need to call bfd_check_format before adding the
object file, or GDB segfaults. To make it even more awesome, the data
that needs to be initialized is hidden behind layers of struct unions
and macros and all kinds of indirection... But I agree that the iovec
is the right way to do it. The BFD_IN_MEMORY flag seems like a hack.
Should I leave that memory leak fix in? It's still an open bug for
GDB/BFD, but it's less critical now that it only happens when someone
does add-symbol-file-from-memory.
Reid
next prev parent reply other threads:[~2009-07-24 23:55 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 1:58 Reid Kleckner
2009-07-23 12:08 ` Reid Kleckner
2009-07-23 23:21 ` Tom Tromey
2009-07-24 13:25 ` Ulrich Weigand
2009-07-24 16:52 ` Doug Evans
2009-07-25 0:40 ` Reid Kleckner [this message]
2009-07-24 16:55 ` Reid Kleckner
2009-07-24 20:42 ` Eli Zaretskii
2009-07-24 20:55 ` Tom Tromey
2009-07-25 15:29 ` Eli Zaretskii
2009-07-27 23:20 ` Reid Kleckner
2009-07-28 20:20 ` Eli Zaretskii
2009-07-28 22:23 ` Reid Kleckner
2009-07-29 15:20 ` Eli Zaretskii
2009-07-24 21:06 ` Tom Tromey
2009-07-25 0:23 ` Reid Kleckner
2009-07-30 16:30 ` Tom Tromey
2009-07-30 16:54 ` Tom Tromey
2009-08-05 21:05 ` [unladen-swallow] " Reid Kleckner
2009-07-30 21:10 ` Thiago Jung Bauermann
2009-07-31 18:18 ` Thiago Jung Bauermann
2009-07-31 20:31 ` [unladen-swallow] " Reid Kleckner
2009-08-01 14:43 ` Thiago Jung Bauermann
2009-08-14 19:29 ` Tom Tromey
2009-08-14 23:37 ` Reid Kleckner
2009-08-17 15:31 ` Tom Tromey
2009-08-20 18:22 ` Doug Evans
2009-08-21 15:17 ` Ken Werner
2009-08-21 16:31 ` Doug Evans
2009-08-21 18:59 ` Ken Werner
2009-08-21 19:53 ` Doug Evans
2009-07-31 20:55 ` Paul Pluzhnikov
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=25eb677d0907241655q11ca995dgd549b6a156f4de3c@mail.gmail.com \
--to=rnk@google.com \
--cc=gdb-patches@sourceware.org \
--cc=rnk@mit.edu \
--cc=tromey@redhat.com \
--cc=unladen-swallow@googlegroups.com \
--cc=uweigand@de.ibm.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