From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21748 invoked by alias); 16 Jan 2004 14:34:57 -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 21735 invoked from network); 16 Jan 2004 14:34:56 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sources.redhat.com with SMTP; 16 Jan 2004 14:34:56 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.12.10/8.12.10) with ESMTP id i0GEYNAO021630; Fri, 16 Jan 2004 14:34:23 GMT Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id i0GEYNe29361; Fri, 16 Jan 2004 14:34:23 GMT Message-Id: <200401161434.i0GEYNe29361@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: Daniel Jacobowitz cc: Andrew Cagney , gdb-patches@sources.redhat.com, rearnsha@arm.com Reply-To: Richard.Earnshaw@arm.com Organization: ARM Ltd. X-Telephone: +44 1223 400569 (direct+voicemail), +44 1223 400400 (switchbd) X-Fax: +44 1223 400410 X-Address: ARM Ltd., 110 Fulbourn Road, Cherry Hinton, Cambridge CB1 9NJ. X-Url: http://www.arm.com/ Subject: Re: RFA/ARM: Switch mode when setting PC In-reply-to: Your message of "Fri, 16 Jan 2004 14:14:56 GMT." <200401161414.i0GEEud05631@pc960.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 16 Jan 2004 14:34:00 -0000 From: Richard Earnshaw X-SW-Source: 2004-01/txt/msg00411.txt.bz2 > > Unless the "Thumb bit" is being stripped out by GDB, then I suspect that > this is a bug in the gdb/simulator binding layer. Any attempt to force > the PC value by the debugger should be taken as a potential state change. > If that is not happening, then all sorts of things may not work. > > I've suspected that there is a problem in the way that gdb drives the > simulator for a while now. > sim_store_register in sim/arm/wrapper.c is currently usring ARMul_SetReg to set the PC. I think this is wrong. RDI_CPUwrite in sim/arm/armrdi.c uses ARMul_SetPC in a similar context. ARMul_SetReg should only be used on the PC in specific circumstances, specifically from within the main simulation loop. Even then it should probably be using ARMul_SetR15. I suspect that this is why several rather gross hacks were introduced over the years to make single stepping work, and what you are seeing now may be another artifact of this general problem. Unfortunately, it may be quite difficult to unwind some of these hacks now (I'm not sure all the changes are in the public repository -- someone with access to the old Cygnus CVS tree may be able to check, but I certainly can't), so the knowledge that there is a problem may not help much in the search for a solution :-( R.