public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "naesten at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/8588] symbols present in multiple files are displayed wrongly
Date: Mon, 04 Feb 2013 20:18:00 -0000	[thread overview]
Message-ID: <bug-8588-4717-NxwgZ8BCWd@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-8588-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=8588

--- Comment #9 from Samuel Bronson <naesten at gmail dot com> 2013-02-04 20:18:26 UTC ---
Note also these possible approaches by Ian Lance Taylor
<http://www.sourceware.org/ml/gdb/2003-12/msg00165.html>:

Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr> writes:

> On Wed, Dec 10, 2003 at 05:12:56PM +0100, Andreas Schwab wrote:
> > It also exists in the executable, due to a COPY relocation.
> 
> Thanks much, I see it now!
> 
> And how should gdb know which one to use?

gdb should always use the one in the executable.  That is the one the
code in the shared library will also be using, because that is the
address will be in the GOT.

In principle, while debugging shared library code, gdb could observe
that there is a GOT relocation for optind, and look at the GOT table
in memory to decide which address to use.

Alternatively, gdb could guess that if there is a global variable in
the executable, that any reference to that global variable in the
shared library will refer to the one in the executable.  This will
normally be true, but will fail in cases where the library is
controlling visibility in any of various different ways.

In practice I have no idea what gdb actually does.

Ian

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2013-02-04 20:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-8588-4717@http.sourceware.org/bugzilla/>
2013-01-27  0:30 ` naesten at gmail dot com
2013-01-28  3:26 ` naesten at gmail dot com
2013-01-29 23:56 ` naesten at gmail dot com
2013-01-30  9:08 ` john at calva dot com
2013-02-01 21:56 ` naesten at gmail dot com
2013-02-01 22:56 ` naesten at gmail dot com
2013-02-02 11:27 ` john at calva dot com
2013-02-04 17:43 ` tromey at redhat dot com
2013-02-04 20:15 ` naesten at gmail dot com
2013-02-04 20:18 ` naesten at gmail dot com
2013-02-04 20:18 ` naesten at gmail dot com [this message]
2013-09-16 15:40 ` tromey at redhat dot com
2014-11-06 18:41 ` pguttmann at bloomberg dot net
2021-10-18 17:39 ` peter.weber at flapflap dot eu

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=bug-8588-4717-NxwgZ8BCWd@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).