Daniel Jacobowitz wrote:
On Tue, Jul 07, 2009 at 11:38:24AM +0200, John Hughes wrote:
I don't get the static version with gcc 4.3 and gdb 6.8 on lenny (x86-64):
(gdb) info var optind
All variables matching regular expression "optind":
File /usr/include/getopt.h:
int optind;
Non-debugging symbols:
0x0000000000600a00 optind@@GLIBC_2.2.5
Maybe this means you don't have libc6-dbg installed? I would have
expected GDB to work in this case, preferring the copy in the
executable. Go figure.
You're right, I don't have libc6-dbg installed (forgot it).
(Just installed it - makes no difference.)
I'm a bit confused - the program itself prints &optind as 0x600a00,
which is what the "non-debugging symbol" optind@@GLIBC_2.2.5 is shown as.
Which copy is the good one?
Just for fun I stripped the executable, now I get:
(gdb) info variables optind
All variables matching regular expression "optind":
Non-debugging symbols:
0x0000000000600a00 optind@@GLIBC_2.2.5
0x00007fe9d712d124 optind
0x00007fe9d712d124 optind
(gdb) p optind
$2 = 1
(gdb) p &optind
$3 = (<data variable, no debug info> *) 0x7fe9d712d124
(gdb)
Drat, it's still getting the wrong one
Here's another reference (the problem has been around for a while):
http://sourceware.org/ml/gdb/2003-12/msg00165.html
For reference this is gdb bugzilla bug 8588, opened 2003-12-12 15:08, previously Gnats 1483
http://sourceware.org/bugzilla/show_bug.cgi?id=8588
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org