From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12681 invoked by alias); 12 Feb 2002 19:46:14 -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 12562 invoked from network); 12 Feb 2002 19:46:12 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 12 Feb 2002 19:46:12 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 56FB03CC2 for ; Tue, 12 Feb 2002 14:46:12 -0500 (EST) Message-ID: <3C697103.5060908@cygnus.com> Date: Tue, 12 Feb 2002 11:46:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.8) Gecko/20020210 X-Accept-Language: en-us MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: think-o: frame.c:find_saved_register() frame1 = get_prev_frame (frame1) backwards? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00189.txt.bz2 Hello, The function frame.c:find_saved_register() contains the code: /* Note that this next routine assumes that registers used in frame x will be saved only in the frame that x calls and frames interior to it. This is not true on the sparc, but the above macro takes care of it, so we should be all right. */ while (1) { QUIT; frame1 = get_prev_frame (frame1); if (frame1 == 0 || frame1 == frame) break; FRAME_INIT_SAVED_REGS (frame1); if (frame1->saved_regs[regnum]) addr = frame1->saved_regs[regnum]; } (it dates back to prior to Red Hats CVS repository). I think this is going the wrong way, looking in frame.h the doco indicates: /* Pointers to the next (down, inner) and previous (up, outer) frame_info's in the frame cache. */ struct frame_info *next; /* down, inner */ struct frame_info *prev; /* up, outer */ and blockframe.c:get_prev_frame() returns the next ``up, outer'': /* If we have the prev one, return it */ if (next_frame->prev) return next_frame->prev; Given: a() { b (); } then it is b() that is saving registers used by a(). And b() is ``down, inner''. confused, Andrew