Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Stuart Hughes <seh@zee2.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: software single step
Date: Fri, 15 Nov 2002 07:09:00 -0000	[thread overview]
Message-ID: <3DD50DD9.7392F27C@zee2.com> (raw)
In-Reply-To: <3DCFEFA0.539D1767@zee2.com>

[-- Attachment #1: Type: text/plain, Size: 1515 bytes --]

Stuart Hughes wrote:
> 
> Daniel Jacobowitz wrote:
> >
> 
> > > Sending packet: $m84c4,4#d0...Ack
> > > Packet received: 060000ea
> > > Sending packet: $M84c4,4:01009fef#15...Ack
> > > Packet received: OK
> > > Sending packet: $c#63...Ack
> > > Packet received: T050b:e4fcffbf;0d:d4fcffbf;0f:c4840000;
> >
> > Same, to 0x84c4.  Now this is the strange one.  What happened?  It
> > seems to have mispredicted the next instruction when placing the
> > breakpoint; the branch was presumably taken.
> >
> 
> Thanks for the pointer, I'll look into it and see if I can make any
> sense of it.
> 

Hi Daniel, 

Thanks for helping me track it down, I've modified the patch as you
suggested and it still works on my strong-arm target.

Some of the traffic for this problem went off the list, so to recap
here's the reasoning for what I've done:  When using gdb/gdbserver, when
stepping at branches, gdb asks for a register dump  by sending the 'g'
remote command, gdbsever in the case of arm, sends back the first 15
registers (gdbserver/linux-arm-low.c defines num_regs to 16, and so
gdbserver/linux-low.c:usr_fetch_inferior_registers actually asks for
registers 0->15  via the regmap in linux-arm-low.c).  If you look at
gdbsever/reg-arm.c, the original regmap is only requesting register
r0->pc, which doesn't include the status register.  Clearly, without the
status register being returned, it's not possible to correctly interpret
condition codes (for branches)

Thanks again for all those who helped.

Regards, Stuart

[-- Attachment #2: patch-arm-gdbserver-step --]
[-- Type: text/plain, Size: 880 bytes --]

diff --exclude CVS -uNr gdb-5.2/gdb/gdbserver/linux-arm-low.c gdb-5.2.modified/gdb/gdbserver/linux-arm-low.c
--- gdb-5.2/gdb/gdbserver/linux-arm-low.c	Wed Feb 27 07:07:39 2002
+++ gdb-5.2.modified/gdb/gdbserver/linux-arm-low.c	Fri Nov 15 10:57:28 2002
@@ -26,11 +26,13 @@
 #include <sys/reg.h>
 #endif
 
-int num_regs = 16;
+int num_regs = 26;
 
 int regmap[] = {
   0, 4, 8, 12, 16, 20, 24, 28,
   32, 36, 40, 44, 48, 52, 56, 60,
+  -1, -1, -1, -1, -1, -1, -1, -1, -1, 
+  64
 };
 
 int
diff --exclude CVS -uNr gdb-5.2/gdb/gdbserver/linux-low.c gdb-5.2.modified/gdb/gdbserver/linux-low.c
--- gdb-5.2/gdb/gdbserver/linux-low.c	Thu Mar  7 20:56:18 2002
+++ gdb-5.2.modified/gdb/gdbserver/linux-low.c	Fri Nov 15 13:58:39 2002
@@ -171,8 +171,6 @@
     error ("Invalid register number %d.", regnum);
 
   addr = regmap[regnum];
-  if (addr == -1)
-    addr = 0;
 
   return addr;
 }


  parent reply	other threads:[~2002-11-15 15:09 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
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 [this message]
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=3DD50DD9.7392F27C@zee2.com \
    --to=seh@zee2.com \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.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