This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: software single step
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Stuart Hughes <seh at zee2 dot com>
- Cc: gdb <gdb at sources dot redhat dot com>
- Date: Sun, 3 Nov 2002 20:22:51 -0500
- Subject: Re: software single step
- References: <3DC52A84.18B7BF92@zee2.com>
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 <main+36>: cmp r3, #9 ; 0x9
> 0x83c8 <main+40>: ble 0x83d0 <main+48>
> 0x83cc <main+44>: b 0x83ec <main+76>
> 0x83d0 <main+48>: ldr r0, [pc, #60] ; 0x8414 <main+116>
>
> 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