From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1506 invoked by alias); 10 Dec 2003 14:49:19 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 1488 invoked from network); 10 Dec 2003 14:49:18 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 10 Dec 2003 14:49:18 -0000 Received: from drow by nevyn.them.org with local (Exim 4.24 #1 (Debian)) id 1AU5eQ-0002NL-8T for ; Wed, 10 Dec 2003 09:49:18 -0500 Date: Wed, 10 Dec 2003 14:49:00 -0000 From: Daniel Jacobowitz To: gdb@sources.redhat.com Subject: Re: optind Message-ID: <20031210144917.GA9115@nevyn.them.org> Mail-Followup-To: gdb@sources.redhat.com References: <20031210142045.GL23712@ata.cs.hacettepe.edu.tr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031210142045.GL23712@ata.cs.hacettepe.edu.tr> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-12/txt/msg00161.txt.bz2 On Wed, Dec 10, 2003 at 04:20:47PM +0200, Baurjan Ismagulov wrote: > Hello, > > given the following program: > > #include > > int main() > { > printf("%p\n", &optind); > } > > > I do: > > gcc -g a.c > ./a.out > nm a.out |grep optind > > > I see, respectively: > > 0x80495ac > 080495ac B optind@@GLIBC_2.0 > > > After that I do: > > gdb a.out > b main > r > p &optind > > > I see: > > $1 = (int *) 0x4014814c, > > whereas I expect it to be 080495ac. Naturally, "p optind" displays > another value, too. What is going on? The symbol exists in multiple shared objects, and gdb gets confused about which copy to print. We can't get this right all the time, but I would have thought we'd get this one right; might want to file a bug report. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer