From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11414 invoked by alias); 23 Jun 2003 19:47:16 -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 11405 invoked from network); 23 Jun 2003 19:47:15 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 23 Jun 2003 19:47:15 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id AFA582B5F; Mon, 23 Jun 2003 15:44:58 -0400 (EDT) Message-ID: <3EF758BA.5060108@redhat.com> Date: Mon, 23 Jun 2003 19:47:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hilfinger@otisco.mckusick.com Cc: gdb@sources.redhat.com Subject: Re: Discrepency between gdbarch_frame_locals_address and get_frame_locals_address? References: <3EF62D05.8070205@redhat.com> <200306231902.h5NJ2Us00812@otisco.McKusick.COM> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00461.txt.bz2 > Andrew, > > Whilst poking around on related things, I observed that, at least on > Linux, Um, which GNU/Linux, which architecture, and how recent a GDB? Lets assume i386 and gdb_6_0-branch. > the values of gdbarch_frame_locals_address and > get_frame_locals_address disagree. The latter appears to be correct, > since it is used in read_var_value in what I assume is the intended > way (add SYMBOL_VALUE to get_frame_locals_address (frame) to get > variable address). Yes. get_frame_locals_address returns what debug info thinks of as the frame base. Local variables being specified as offsets from that address. Just don't confuse it with gdb's [deprecated] get_frame_base :-( > Would you like a patch, or is there a subtle > point here that I am missing? There is likely a subtle point^D^D^Dproblem vis: The backward compatible path is get_frame_locals_address -> [deprecated] gdbarch_frame_locals_address -> get_frame_base -> get_frame_id.stack_addr and, so pre-frame code has identical values for both. New code, however, has a different frame ID .stack_addr and frame-locals-address. You've probably found code using the wrong one. Andrew