From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 852 invoked by alias); 6 Feb 2009 20:22:12 -0000 Received: (qmail 834 invoked by uid 22791); 6 Feb 2009 20:22:11 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from rv-out-0506.google.com (HELO rv-out-0506.google.com) (209.85.198.239) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Feb 2009 20:22:06 +0000 Received: by rv-out-0506.google.com with SMTP id g9so530847rvb.0 for ; Fri, 06 Feb 2009 12:22:04 -0800 (PST) Received: by 10.141.203.7 with SMTP id f7mr1565381rvq.256.1233951723482; Fri, 06 Feb 2009 12:22:03 -0800 (PST) Received: from ?10.0.1.197? (dhcp-004086.ics.uci.edu [128.195.4.86]) by mx.google.com with ESMTPS id f42sm3379649rvb.5.2009.02.06.12.22.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Feb 2009 12:22:02 -0800 (PST) Cc: gdb@sourceware.org Message-Id: <8A4E42EC-54D4-449D-BAB5-C05F6DD97090@gmail.com> From: Nityananda To: Thiago Jung Bauermann In-Reply-To: <1233921666.14735.108.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Help needed with browsing GDB code Date: Fri, 06 Feb 2009 20:22:00 -0000 References: <249DE25A-9555-4D36-8C59-56EF08F2E34A@gmail.com> <1233921666.14735.108.camel@localhost.localdomain> 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-02/txt/msg00066.txt.bz2 HI Thiago, Thanks for the information. I am reading the code to deal with the=20=20 stack frame information without the debug information. Can you please=20=20 point me to the code with the debug information? You mentioned that it=20=20 uses DWARF2. So are the local variables always at the same offset of=20=20 the frame base address or there is a possibility of these addresses=20=20 changing from one process to another? Thank you very much in advance, Nityananda On Feb 6, 2009, at 4:01 AM, Thiago Jung Bauermann wrote: > Hi Nityananda, > > El jue, 05-02-2009 a las 18:26 -0800, Nityananda escribi=F3: >> I am looking for how >> GDB obtains the address of stack local variables. I am seeing some >> code related to frame_info but do not know how it actually works. > > Well, there are two situations: with debug information available, and > without. For the first case it's simple: the DWARF2 format includes=20=20 > the > frame base address as part of the unwind information, and addresses of > local variables in the debuginfo are relative to that base address. > > When there's no debuginfo available, GDB uses its knowledge of the OS > ABI for the given architecture. For example, for ppc64-linux, the=20=20 > stack > frame layout is given here: > > http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#STACK > > And the code which uses that knowledge is in > rs6000-tdep.c:rs6000_frame_cache. It's kinda hairy... > --=20 > []'s > Thiago Jung Bauermann > IBM Linux Technology Center >