public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
@ 2010-06-29 11:51 mathieu dot lacage at gmail dot com
2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
0 siblings, 2 replies; 3+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:51 UTC (permalink / raw)
To: gdb-prs
The crux of the problem is that gdb believes that two entries in the inferior
linkmap are the same if the associated filename is the same. If you use dlmopen
to load the same binary twice at different base addresses, the correct test for
equality is if the filenames are the same _and_ the base addresses are the same.
the attached tarball contains a minimal testcase to reproduce this bug and the
attached patch fixes this bug as suggested by tom tromey on the gdb mailing-list.
how to reproduce:
tar zxf test.tar.gz
cd test
gdb ./test
run b
output:
#0 0x00007ffff785c567 in ?? ()
#1 0x00007fffffffe0b0 in ?? ()
#2 0x0000000000400641 in call (h=0x7ffff785c557,
expected output:
the symbol 'bar' should be resolved.
--
Summary: gdb does not resolve correctly symbols in binaries
loaded twice with dlmopen
Product: gdb
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: symtab
AssignedTo: unassigned at sourceware dot org
ReportedBy: mathieu dot lacage at gmail dot com
CC: gdb-prs at sourceware dot org
GCC build triplet: x86_64-redhat-linux-gnu
GCC host triplet: x86_64-redhat-linux-gnu
GCC target triplet: x86_64-redhat-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=11766
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug symtab/11766] gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
@ 2010-06-29 11:52 ` mathieu dot lacage at gmail dot com
2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:52 UTC (permalink / raw)
To: gdb-prs
------- Additional Comments From mathieu dot lacage at gmail dot com 2010-06-29 11:52 -------
Created an attachment (id=4861)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4861&action=view)
reduced testcase
this program shows that gdb can resolve correctly the symbols in the first
version of the binary loaded with dlmopen but not with the second version. (try
'run a' vs 'run b')
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11766
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug symtab/11766] gdb does not resolve correctly symbols in binaries loaded twice with dlmopen
2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
@ 2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
1 sibling, 0 replies; 3+ messages in thread
From: mathieu dot lacage at gmail dot com @ 2010-06-29 11:54 UTC (permalink / raw)
To: gdb-prs
------- Additional Comments From mathieu dot lacage at gmail dot com 2010-06-29 11:54 -------
Created an attachment (id=4862)
--> (http://sourceware.org/bugzilla/attachment.cgi?id=4862&action=view)
fix this bug
This patch makes sure that gdb creates one debuginfo entry exists per
inferior-loaded-library.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11766
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-06-29 11:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29 11:51 [Bug symtab/11766] New: gdb does not resolve correctly symbols in binaries loaded twice with dlmopen mathieu dot lacage at gmail dot com
2010-06-29 11:52 ` [Bug symtab/11766] " mathieu dot lacage at gmail dot com
2010-06-29 11:54 ` mathieu dot lacage at gmail dot com
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).