Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Small problem with Remote Protocol register fetching.
@ 2004-06-15  8:21 Steven Johnson
  2004-06-15 15:26 ` Andrew Cagney
  2004-06-15 18:52 ` Michael Snyder
  0 siblings, 2 replies; 7+ messages in thread
From: Steven Johnson @ 2004-06-15  8:21 UTC (permalink / raw)
  To: gdb-patches

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

Registers in the remote protocol are Hex Encoded.  Hex encoded values 
can have (as far as I can tell, valid values of '0'-'9','a'-'f','A'-'F' 
and ('x' for registers). the problem is that register packets that have 
an upper case 'A'-'F' in the first location are junked as being bad 
packets, when their is nothing wrong.  And then GDB ends up in an 
infinite comms loop, trying to recover.

The attached patch allows Hex Encoded values to include upper case 
letters (in the case of fetching registers) without causing the packet 
handling to fail.

I wasnt sure if 'X' should also be allowable, seems like it should, but 
i dont know for sure, so havent changed it.

Steven Johnson



[-- Attachment #2: gdb-6.1-rsp-hexencodecasecheck.patch --]
[-- Type: text/x-patch, Size: 625 bytes --]

diff -p -u -r clean-src/insight-6.1/gdb/frame.c mod-src/insight-6.1/gdb/frame.c
diff -p -u -r clean-src/insight-6.1/gdb/remote.c mod-src/insight-6.1/gdb/remote.c
--- clean-src/insight-6.1/gdb/remote.c	2004-02-26 06:41:00.000000000 +1000
+++ mod-src/insight-6.1/gdb/remote.c	2004-06-15 16:36:53.000000000 +1000
@@ -3278,6 +3278,7 @@ remote_fetch_registers (int regnum)
      and try to fetch another packet to read.  */
   while ((buf[0] < '0' || buf[0] > '9')
 	 && (buf[0] < 'a' || buf[0] > 'f')
+	 && (buf[0] < 'A' || buf[0] > 'F')
 	 && buf[0] != 'x')	/* New: unavailable register value */
     {
       if (remote_debug)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-24 18:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-15  8:21 Small problem with Remote Protocol register fetching Steven Johnson
2004-06-15 15:26 ` Andrew Cagney
2004-06-15 18:52 ` Michael Snyder
2004-06-16  0:41   ` Steven Johnson
2004-06-16 18:14     ` Andrew Cagney
2004-06-16 22:47       ` Steven Johnson
2004-06-24 18:12         ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox