From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16718 invoked by alias); 27 Apr 2009 06:32:08 -0000 Received: (qmail 16709 invoked by uid 22791); 27 Apr 2009 06:32:08 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 X-Spam-Check-By: sourceware.org Received: from mail.redpinesignals.com (HELO mail.redpinesignals.com) (203.196.161.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 27 Apr 2009 06:32:03 +0000 Received: from [192.168.40.84] ([192.168.40.84]) (authenticated user sumanth.gundapneni@redpinesignals.com) by mail.redpinesignals.com; Mon, 27 Apr 2009 11:58:49 +0530 Message-ID: <49F54F67.8@redpinesignals.com> Date: Mon, 27 Apr 2009 06:36:00 -0000 From: sumanth User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Paul Pluzhnikov CC: gdb@sourceware.org Subject: Re: gcc - gdb compatibility issue References: <49F53FD6.5040209@redpinesignals.com> <8ac60eac0904262303q4f5b430ak5a14ba34f3dedd7f@mail.gmail.com> In-Reply-To: <8ac60eac0904262303q4f5b430ak5a14ba34f3dedd7f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00201.txt.bz2 hi, I tried compiling with '-g -O0' option, result is same. Since I am not using a well known architecture , i need to port gdb to my architecture. gcc --version gives gcc (GCC) 4.1.1 20061011 (Red Hat 4.1.1-30). The problem here is ,it is generating local variables address but not in the current frame. But when I compile with '-g -O0 -fvar-tracking ' I got partial correct information . Let me explain with an example : int main() { volatile int a, b , c; a =10; b =20; c =add(a,b); return 0; } int add(int x, int y) { return x+y; } With '-g -O0' all the local variable's address i.e a,b,c generated is wrong. with '-g -O0 -fvar-tracking ' a,b 's address is generated correct. c variable's address is wrong. I am confident that there is no error from compiler side . So, I am asking for any compatibility issue regarding gcc-gdb versions. sumanth Paul Pluzhnikov wrote: > On Sun, Apr 26, 2009 at 10:17 PM, sumanth > wrote: > > >> I am using gcc-4.3.3 and gdb 5.3 version. >> > > That's a rather new GCC and rather old GDB. > > >> I have problems in debugging my binaries (a.out) concerned to local >> variable's address location. >> > > What kind of problems? > Did you compile with -O, -O2, or -O3? > Debugging optimized code is always problematic: the compiler may not > have assigned address for a local variable at all. > > >> Is there any gcc-gdb compatibility issue here. If so how can I generate the >> correct debugging information and use it. >> > > Start by compiling with '-g -O0'. > If that doesn't work, try current GDB built from CVS Head. > If that still doesn't work, show us your compile line, and output from > 'gcc --version'. > > Cheers, >