This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] monitor.c fix for rom68k target boards


This patch allows gdb to work with rom68k target boards once again (it's 
been broken for a year and a half apparently).

I don't think the routine needs to care about checking for termination of 
the string.  In the case of this monitor, the SR is returned as 
"2700-tfSm.111...xnzvc" for example.  Before Jason's change to this 
routine, it used strtoul which ended the matching at the first non 
digit.  Jason changed it to work with values larger than 'long' so it's 
now a hand-coded loop to gather the digits.

2001-03-29  Jeff Holcomb  <jeffh@redhat.com>

        * monitor.c (monitor_supply_register): Don't check for trailing
        junk since the rom68k monitor includes trailing junk in the
        status register.

Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.22
diff -u -p -r1.22 monitor.c
--- monitor.c   2001/03/28 21:42:31     1.22
+++ monitor.c   2001/03/30 05:51:28
@@ -906,9 +906,8 @@ monitor_supply_register (int regno, char
     }
   monitor_debug ("Supplying Register %d %s\n", regno, valstr);

-  if (*p != '\0')
-    error ("monitor_supply_register (%d):  bad value from monitor: %s.",
-          regno, valstr);
+  /* Don't check for trailing junk since the 68k SR includes trailing
+     junk.  */

   /* supply register stores in target byte order, so swap here */



--
Jeff Holcomb
jeffh@redhat.com
GDB Engineering
Red Hat, Inc.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]