From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12415 invoked by alias); 6 Feb 2009 12:01:17 -0000 Received: (qmail 12238 invoked by uid 22791); 6 Feb 2009 12:01:16 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from e24smtp04.br.ibm.com (HELO e24smtp04.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Feb 2009 12:01:12 +0000 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by e24smtp04.br.ibm.com (8.13.1/8.13.1) with ESMTP id n16BxjxE019779 for ; Fri, 6 Feb 2009 09:59:45 -0200 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n16D0ala3973162 for ; Fri, 6 Feb 2009 10:00:36 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n16C18xs009044 for ; Fri, 6 Feb 2009 10:01:08 -0200 Received: from [9.18.201.230] ([9.18.201.230]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n16C18aq009033; Fri, 6 Feb 2009 10:01:08 -0200 Subject: Re: Help needed with browsing GDB code From: Thiago Jung Bauermann To: Nityananda Cc: gdb@sourceware.org In-Reply-To: <249DE25A-9555-4D36-8C59-56EF08F2E34A@gmail.com> References: <249DE25A-9555-4D36-8C59-56EF08F2E34A@gmail.com> Content-Type: text/plain; charset=utf-8 Date: Fri, 06 Feb 2009 12:01:00 -0000 Message-Id: <1233921666.14735.108.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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/msg00062.txt.bz2 Hi Nityananda, El jue, 05-02-2009 a las 18:26 -0800, Nityananda escribió: > 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 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 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... -- []'s Thiago Jung Bauermann IBM Linux Technology Center