From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21725 invoked by alias); 3 Apr 2008 21:48:19 -0000 Received: (qmail 21714 invoked by uid 22791); 3 Apr 2008 21:48:18 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Apr 2008 21:47:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id F2A83983BE; Thu, 3 Apr 2008 21:47:53 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id BB7C498278; Thu, 3 Apr 2008 21:47:53 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JhXHk-0005Uv-6s; Thu, 03 Apr 2008 17:47:52 -0400 Date: Fri, 04 Apr 2008 02:30:00 -0000 From: Daniel Jacobowitz To: Antony KING Cc: gdb@sourceware.org Subject: Re: Problem setting registers if stack point or frame pointer is 0 Message-ID: <20080403214752.GA20869@caradoc.them.org> Mail-Followup-To: Antony KING , gdb@sourceware.org References: <47F54DAD.9070302@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47F54DAD.9070302@st.com> User-Agent: Mutt/1.5.17 (2007-12-11) 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: 2008-04/txt/msg00034.txt.bz2 On Thu, Apr 03, 2008 at 10:35:41PM +0100, Antony KING wrote: > Hi, > > I have a problem trying to set a CPU register (using the GDB convenience > variable mechanism) if the stack pointer (SP) or frame pointer (FP) CPU > registers are 0. For example on an SH-4 device, where the FP register is > R14 and the SP register is R15, I see the following error from GDB > (6.7.1): This is an unfortunate design problem in GDB. You've found the right comment, but in fact the comment lies. /* ZERO denotes the null frame, let the caller decide what to do about it. Should it instead return get_current_frame()? */ It doesn't denote just the null frame (nothing running). It also denotes the last frame (can not unwind past here, outermost). We've really got to get rid of that ambiguity. I use a terrible hack in find_frame_by_id in our tools, since I still haven't found time to return to this problem :-( -- Daniel Jacobowitz CodeSourcery