From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16676 invoked by alias); 3 Apr 2008 21:36:10 -0000 Received: (qmail 16658 invoked by uid 22791); 3 Apr 2008 21:36:09 -0000 X-Spam-Check-By: sourceware.org Received: from s200aog13.obsmtp.com (HELO s200aog13.obsmtp.com) (207.126.144.127) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 03 Apr 2008 21:35:45 +0000 Received: from source ([164.129.1.35]) (using TLSv1) by eu1sys200aob013.postini.com ([207.126.147.11]) with SMTP; Thu, 03 Apr 2008 21:35:43 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6EE7DA4A for ; Thu, 3 Apr 2008 21:35:42 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 63EDE4C27C for ; Thu, 3 Apr 2008 21:35:42 +0000 (GMT) Received: from [164.129.14.85] (bri1017.bri.st.com [164.129.14.85]) by mail1.bri.st.com (MOS 3.7.5a-GA) with ESMTP id CJY47801 (AUTH antony); Thu, 3 Apr 2008 22:34:48 +0100 (BST) Message-ID: <47F54DAD.9070302@st.com> Date: Fri, 04 Apr 2008 02:21:00 -0000 From: Antony KING User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: gdb@sourceware.org Subject: Problem setting registers if stack point or frame pointer is 0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00033.txt.bz2 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): (gdb) (gdb) set $r15 = 0 (gdb) set $pc = 0xa0000000 Value being assigned to is no longer active. (gdb) The error is being generated by value_assign() (valops.c) in the following code sequence: case lval_register: { struct frame_info *frame; int value_reg; /* Figure out which frame this is in currently. */ frame = frame_find_by_id (VALUE_FRAME_ID (toval)); value_reg = VALUE_REGNUM (toval); if (!frame) error (_("Value being assigned to is no longer active.")); I can make the problem "go away" if I insert the following after the call to frame_find_by_id() in the above code: if (!frame) frame = get_current_frame(); This solution was "suggestion" by a source comment in the implementation of frame_find_by_id(). Is this the right solution do you think ? (I am not familiar with the frame management of GDB so I thought I would ask those more in the know about this aspect of GDB internals :-). Cheers, Antony.