From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2419 invoked by alias); 1 Mar 2005 10:21:29 -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 2330 invoked from network); 1 Mar 2005 10:21:19 -0000 Received: from unknown (HELO calvin.codito.co.in) (220.225.32.98) by sourceware.org with SMTP; 1 Mar 2005 10:21:19 -0000 Received: from [192.168.100.52] (arnor.codito.co.in [192.168.100.52]) by calvin.codito.co.in (8.12.10/8.12.10) with ESMTP id j21AL3BP010149; Tue, 1 Mar 2005 15:51:05 +0530 Message-ID: <4224420F.5030906@codito.com> Date: Tue, 01 Mar 2005 10:21:00 -0000 From: Ramana Radhakrishnan User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) MIME-Version: 1.0 To: Roopesh Kohad CC: gdb@sources.redhat.com Subject: Re: function address from object file? References: <1a223dc60503010114bbb95fd@mail.gmail.com> In-Reply-To: <1a223dc60503010114bbb95fd@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-03/txt/msg00001.txt.bz2 Hi, > Hi, > I am trying to print function address by reading an object file. > But the function address are all shown to be zero. How serious is this > bug? Here is the repro:- > > $ cat a.c > #include > > void t(void) > { > int i=0; > printf("%d\n",i); > } > > void u(void) > { > int i=0; > printf("%d\n",i); > } > > int main() > { > t(); > return 0; > } > > > $ gcc -c -g -o a.o a.c This is not a bug . Go look at the doco for gcc -c . It only creates object files and not executables. So these are not complete executables in the first place.So gdb is ok in what it is doing in this case. cheers Ramana -- Ramana Radhakrishnan GNU Tools codito ergo sum (www.codito.com)