From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28144 invoked by alias); 16 Jan 2004 19:12:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28134 invoked from network); 16 Jan 2004 19:12:20 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 16 Jan 2004 19:12:20 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2A8D72B8F; Fri, 16 Jan 2004 14:12:18 -0500 (EST) Message-ID: <40083792.7020102@gnu.org> Date: Fri, 16 Jan 2004 19:12:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 MIME-Version: 1.0 To: Richard.Earnshaw@arm.com Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com, rearnsha@arm.com Subject: Re: RFA/ARM: Switch mode when setting PC References: <200401161727.i0GHRxt24387@pc960.cambridge.arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-01/txt/msg00421.txt.bz2 > For example, if the user writes a 32-bit value into the PC, the CPSR state >> > probably shouldn't be changed (even if the bottom bit is altered) -- this >> > is how ARM's debuggers behave. However, if the user 'calls' a function >> > that is in the 'other state', then the CPSR should be updated (and >> > presumably restored afterwards). >> > >> > I'm not sure if GDB has a way of separating these two cases. It's an >> > interesting problem. > >> >> I believe that this will work at present, because setting $pc will not >> go through write_pc. There's some blind luck involved in this, though. Or a lack of design, Arm needs to ensure that it doesn't define PC_REGNUM. > In the past we've tried to distinguish R15 from PC. This was especially > useful in the legacy 26-bit mode where the CPSR bits *were* in R15. > > This would probably all have been much simpler if I'd been able to > complete my code for handling the banked register; sadly I never got far > enough, and I think the code is probably too bit-rotten to be worth trying > to resurrect directly at this point. If there's an explicit "set_resume_address", separate to write_pc, this should happen: (gdb) set $r15 = 0x123 - target sees: $r15=0x123 (gdb) call foo() OR (gdb) jump foo - target, via "set_resume_address", sees: $r15=&foo $ps&|= and significantly no other write_pc calls. Andrew