From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1722 invoked by alias); 1 Feb 2013 21:56:52 -0000 Received: (qmail 1702 invoked by uid 48); 1 Feb 2013 21:56:52 -0000 From: "naesten at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/8588] symbols present in multiple files are displayed wrongly Date: Fri, 01 Feb 2013 21:56:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: naesten at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2013-q1/txt/msg00165.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D8588 --- Comment #4 from Samuel Bronson 2013-02-01 21= :56:51 UTC --- Strange. This is what I get: naesten@hydrogen:~/hacking/bugs% cat a.c #include int main() { printf("%p\n", &optind); } naesten@hydrogen:~/hacking/bugs% gcc -g a.c a.c: In function =E2=80=98main=E2=80=99: a.c:5:2: warning: incompatible implicit declaration of built-in function =E2=80=98printf=E2=80=99 [enabled by default] naesten@hydrogen:~/hacking/bugs% gcc --version gcc (Debian 4.7.2-5) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. naesten@hydrogen:~/hacking/bugs% ./a.out 0x8049740 naesten@hydrogen:~/hacking/bugs% nm a.out | grep optind 08049740 B optind naesten@hydrogen:~/hacking/bugs% nm --dynamic a.out | grep optind 08049740 B optind naesten@hydrogen:~/hacking/bugs% cat a.c #include int main() { printf("%p\n", &optind); } naesten@hydrogen:~/hacking/bugs% gcc --version gcc (Debian 4.7.2-5) 4.7.2 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. naesten@hydrogen:~/hacking/bugs% ./a.out 0x8049740 naesten@hydrogen:~/hacking/bugs% nm a.out |grep optind 08049740 B optind naesten@hydrogen:~/hacking/bugs% gdb a.out GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/naesten/hacking/bugs/a.out...done. (gdb) b main Breakpoint 1 at 0x80484d5: file a.c, line 5. (gdb) r Starting program: /home/naesten/hacking/bugs/a.out Breakpoint 1, main () at a.c:5 5 printf("%p\n", &optind); (gdb) p &optind $1 =3D (int *) 0x8049740 (gdb) info variables optind All variables matching regular expression "optind": File getopt.c: int optind; (gdb) This leaves me wondering: Is this really architecture-dependent, or is it j= ust due to chance (different addresses, hash collisions, etc.) that it works fo= r me and not for you? My questions for you are: 1. What version of libc6-dev do you have installed? 2. What do you get for "info variables optind"? --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.