From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6606 invoked by alias); 4 Nov 2002 01:22:16 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 6543 invoked from network); 4 Nov 2002 01:22:15 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 4 Nov 2002 01:22:15 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 188Wrn-0003ag-00; Sun, 03 Nov 2002 20:21:27 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 188Vx5-0001zX-00; Sun, 03 Nov 2002 20:22:51 -0500 Date: Sun, 03 Nov 2002 17:22:00 -0000 From: Daniel Jacobowitz To: Stuart Hughes Cc: gdb Subject: Re: software single step Message-ID: <20021104012251.GB7441@nevyn.them.org> Mail-Followup-To: Stuart Hughes , gdb References: <3DC52A84.18B7BF92@zee2.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DC52A84.18B7BF92@zee2.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-11/txt/msg00023.txt.bz2 On Sun, Nov 03, 2002 at 08:54:12AM -0500, Stuart Hughes wrote: > Hi, > > I'm trying to use gdb/gdbserver to debug a strong-arm target. I'm > having problems with single stepping. If I try to step into the loop > shown below, it simply runs on printing all 10 loop iterations. > > for ( i = 0; i < 10 ; i++ ) { > printf("loop count = %d\n", i); > } > > If I disassemble, the problem seems to be the branch instructions, the > loop control looks like: > > 0x83c4 : cmp r3, #9 ; 0x9 > 0x83c8 : ble 0x83d0 > 0x83cc : b 0x83ec > 0x83d0 : ldr r0, [pc, #60] ; 0x8414 > > To investigate this further, I built a "native" gdb for the strong-arm > from the same code gdb code base. This worked correectly, I was able to > step into and control the flow through the loop. > > It seems as though the problem is that gdbserver is implementing > software_single_step differently to a "native" gdb. > > Has anyone else seen this problem ? Does anyone know of a work around, > or a fix ? gdbserver doesn't implement software single step; the connected GDB client handles it. You may want to 'set debug target 1' and 'set debug remote 1', and watch for differences. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer