From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1000 invoked by alias); 4 Apr 2008 17:32:49 -0000 Received: (qmail 991 invoked by uid 22791); 4 Apr 2008 17:32:48 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Apr 2008 17:32:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0EA502A9F5D for ; Fri, 4 Apr 2008 13:32:28 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id CYsMeGePnjzE for ; Fri, 4 Apr 2008 13:32:27 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A7BD72AA054 for ; Fri, 4 Apr 2008 13:32:27 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id DB8BCE7ACD; Fri, 4 Apr 2008 10:32:24 -0700 (PDT) Date: Fri, 04 Apr 2008 19:16:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFC 2/5] Frame unwinding using struct value Message-ID: <20080404173224.GE23283@adacore.com> References: <20080331221024.GA22334@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080331221024.GA22334@caradoc.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00105.txt.bz2 > (frame_register_unwind): Remove debug messages. Use > frame_unwind_register_value. It looks like we'll also be able to get rid of this function at some point soon. As far as I can tell, I can only find 2 places where it's being used: - mep-tdep.c: But this will disappear as soon as we convert the function using it; - stack.c:frame_info() I think we can adjust the code to use frame_unwind_register_value instead. The code looks like this: /* Find out the location of the saved stack pointer with out actually evaluating it. */ frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch), &optimized, &lval, &addr, &realnum, NULL); if (!optimized && lval == not_lval) { gdb_byte value[MAX_REGISTER_SIZE]; CORE_ADDR sp; frame_register_unwind (fi, gdbarch_sp_regnum (gdbarch), &optimized, &lval, &addr, &realnum, value); /* NOTE: cagney/2003-05-22: This is assuming that the stack pointer was packed as an unsigned integer. That may or may not be valid. */ sp = extract_unsigned_integer (value, register_size (gdbarch, gdbarch_sp_regnum (gdbarch))); printf_filtered (" Previous frame's sp is "); fputs_filtered (paddress (sp), gdb_stdout); printf_filtered ("\n"); need_nl = 0; } else if (!optimized && lval == lval_memory) { printf_filtered (" Previous frame's sp at "); fputs_filtered (paddress (addr), gdb_stdout); printf_filtered ("\n"); need_nl = 0; } else if (!optimized && lval == lval_register) { printf_filtered (" Previous frame's sp in %s\n", gdbarch_register_name (gdbarch, realnum)); need_nl = 0; -- Joel