Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Stuart Hughes <seh@zee2.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: software single step
Date: Sun, 03 Nov 2002 17:22:00 -0000	[thread overview]
Message-ID: <20021104012251.GB7441@nevyn.them.org> (raw)
In-Reply-To: <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


  reply	other threads:[~2002-11-04  1:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-03  5:54 Stuart Hughes
2002-11-03 17:22 ` Daniel Jacobowitz [this message]
2002-11-11  9:13   ` Stuart Hughes
2002-11-11  9:50     ` Daniel Jacobowitz
     [not found]       ` <3DCFEFA0.539D1767@zee2.com>
2002-11-15  7:09         ` Stuart Hughes
2002-11-15  9:52           ` Robert Schwebel
2002-11-16  1:23             ` Stuart Hughes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021104012251.GB7441@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=seh@zee2.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox