public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Cc: gdb-patches@sourceware.org
Subject: Re: impossible to resolve symbols in same binary loaded twice with dlmopen
Date: Thu, 08 Jul 2010 20:32:00 -0000	[thread overview]
Message-ID: <m3zky14sw5.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1278528582.10151.23.camel@localhost.localdomain> (Mathieu	Lacage's message of "Wed, 07 Jul 2010 20:49:42 +0200")

>>>>> "Mathieu" == Mathieu Lacage <mathieu.lacage@sophia.inria.fr> writes:

Mathieu> 2010-XX-XX Mathieu Lacage <mathieu.lacage@inria.fr>
Mathieu>         Fix PR/gdb 11766: gdb does not resolve correctly symbols in
Mathieu> binaries loaded twice with dlmopen

I think this is a reasonable idea.

First, I'm curious: does gdb detect dlmopen calls automatically?  I
thought there was some missing glibc feature here.  I haven't looked
into it too much since I wasn't aware of anybody really using dlmopen.
If gdb cannot do this, please file a bug report.

I am not completely sure that this patch is sufficient.

It doesn't seem like it would handle PIE properly.  I think you would
have to modify objfile_relocate as well.

I was wondering if there is a possible bug with a program dlmopen()ing
itself, but after thinking about it my guess is no.

Otherwise it seems reasonable to me.


Once you have this patch, does it really work?  It seems like it would
work ok for some things, like backtraces, but not other things.  E.g.,
does symbol lookup work properly in the dlmopen case?  I would imagine
that it does or does not depending on the ordering of objfiles in gdb's
internal list.

Tom

  reply	other threads:[~2010-07-08 20:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 18:49 Mathieu Lacage
2010-07-08 20:32 ` Tom Tromey [this message]
2010-07-09 11:37   ` Mathieu Lacage
2010-07-09 11:42     ` Mathieu Lacage
2010-07-20 19:38     ` Tom Tromey
2010-07-25 12:25       ` Mathieu Lacage
2011-01-20 14:51         ` Mathieu Lacage
2011-01-26 10:52           ` Thiago Jung Bauermann
2011-01-28 11:10             ` Tom Tromey
2011-01-29 10:32               ` Thiago Jung Bauermann
2011-01-31 17:50                 ` Tom Tromey
2010-07-08 15:59 Mathieu Lacage

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=m3zky14sw5.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mathieu.lacage@sophia.inria.fr \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).