This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit+7.6.1] [patch] [7.6.1] Fix argv[0] symlink regression (PR 15415)
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Wed, 04 Sep 2013 11:48:41 +0100
- Subject: Re: [commit+7.6.1] [patch] [7.6.1] Fix argv[0] symlink regression (PR 15415)
- Authentication-results: sourceware.org; auth=none
- References: <20130826182111 dot GA19509 at host2 dot jankratochvil dot net> <21019 dot 47767 dot 404597 dot 352962 at ruffy dot mtv dot corp dot google dot com> <20130827140915 dot GA17861 at host2 dot jankratochvil dot net> <21022 dot 10862 dot 436924 dot 879667 at ruffy dot mtv dot corp dot google dot com> <20130828180359 dot GB4770 at host2 dot jankratochvil dot net>
It seems this patch introduces some output inconsistency
(only tried mainline):
$ ./gdb
...
(gdb) file ./gdb
Reading symbols from /home/pedro/gdb/mygit/build/gdb/gdb...done.
Setting up the environment for debugging gdb.
(top-gdb) info inferiors
Num Description Executable
* 1 <null> /home/pedro/gdb/mygit/build/gdb/./gdb
(top-gdb)
Note "gdb/gdb" vs "gdb/./gdb".
(top-gdb) file gdbserver/../gdb
Load new symbol table from "/home/pedro/gdb/mygit/build/gdb/gdb"? (y or n) y
Reading symbols from /home/pedro/gdb/mygit/build/gdb/gdb...done.
(top-gdb) info inferiors
Num Description Executable
* 1 <null> /home/pedro/gdb/mygit/build/gdb/gdbserver/../gdb
(top-gdb)
Note ".../gdb/gdb" vs ".../gdb/gdbserver/../gdb".
I tried your new series at
<https://sourceware.org/ml/gdb-patches/2013-08/msg00837.html>, and
seems there's still some inconsistency:
(gdb) file ./gdb
Reading symbols from /home/pedro/gdb/mygit/build/gdb/./gdb...done.
Setting up the environment for debugging gdb.
(top-gdb) info inferiors
Num Description Executable
* 1 <null> /home/pedro/gdb/mygit/build/gdb/./gdb
(top-gdb) info files
Symbols from "/home/pedro/gdb/mygit/build/gdb/./gdb".
Local exec file:
`/home/pedro/gdb/mygit/build/gdb/./gdb', file type elf64-x86-64.
This one's consistent now, but then this one's odd:
(top-gdb) file gdbserver/../gdb
Load new symbol table from "/home/pedro/gdb/mygit/build/gdb/./gdb"? (y or n) y
Reading symbols from /home/pedro/gdb/mygit/build/gdb/./gdb...done.
(top-gdb) info inferiors
Num Description Executable
* 1 <null> /home/pedro/gdb/mygit/build/gdb/gdbserver/../gdb
(top-gdb)
Hmm. It seems to only happen after having loaded "./gdb" first. This
sounds like related to the filename handling in the gdb/bfd cache? GDB
finds reuses the same bfd (as gdbserver/../gdb is the same file as
the previous ./gdb), and then we printing the filename that had
been associated with the bfd before, instead of the one that was
specified in the second "file" ?
--
Pedro Alves