From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6692 invoked by alias); 3 Sep 2003 09:51:47 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 6641 invoked from network); 3 Sep 2003 09:51:40 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.54) by sources.redhat.com with SMTP; 3 Sep 2003 09:51:40 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.9.3/8.9.3) with ESMTP id KAA02049; Wed, 3 Sep 2003 10:51:27 +0100 (BST) Received: from pc960.cambridge.arm.com (rearnsha@localhost) by pc960.cambridge.arm.com (8.11.6/8.9.3) with ESMTP id h839pRY16299; Wed, 3 Sep 2003 10:51:27 +0100 Message-Id: <200309030951.h839pRY16299@pc960.cambridge.arm.com> X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha owned process doing -bs To: mckennad@esatclear.ie cc: Richard Earnshaw , gdb@sources.redhat.com, insight@sources.redhat.com, Richard.Earnshaw@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: ARM Simulator Bug? In-reply-to: Your message of "Wed, 03 Sep 2003 10:13:53 BST." <3f55b0d1.2580.0@esatclear.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 03 Sep 2003 09:51:00 -0000 From: Richard Earnshaw X-SW-Source: 2003-q3/txt/msg00139.txt.bz2 > Hi Richard, > > >Try using an > > > > LDR r0, =__thumb > > > > This command places the correct value into R0 for the BX command, but the bug > within the simulator is still present. > > Take the following code as an example. > > 0000005c : > 5c: e3a0da12 mov sp, #73728 ; 0x12000 > 60: e59f00a4 ldr r0, [pc, #164] ; 10c > 64: e12fff10 bx r0 > > 00000068 <__start_of_thumb>: > > void IRQ_Interrupt(void); > > int main() > { > 68: b580 push {r7, lr} > 6a: 466f mov r7, sp > 6c: b082 sub sp, #8 > > If I place a breakpoint at 0x6c and run the code gdb loses itself, i.e. if I > interrupt it with ctrl-c it says the PC is 0x0580fa70 or some thing similar. > Again, if I place a breakpoint at 0x5c, I can single step successfully. If I > single step to 0x68 and place a breakpoint at 0x6c and continue, gdb loses itself > again. > > This problem only occurs when I attempt to use thumb. If I remove the bx command > and compile my C file in ARM mode the simulator works perfectly. Hmm, you are building *all* of your source with -g aren't you? gdb can get very confused if it doesn't know whether it's debugging ARM or Thumb code and it defaults to ARM when it doesn't know (another side-effect of no mapping symbols). Another thing to consider: Is the processor taking an abort on the push instruction and jumping into the abort handler? Try putting an a breakpoint at address 0x00000010. Alternatively, check the value of SP before stepping the instruction. > > Is it possible to see which commands the simulator is executing? > I'm not aware of any simple way to do that. I agree that there are times when it would be useful. R.