[commit] Fix remote debugging when DEPRECATED_REGISTER_BYTES == 0

Daniel Jacobowitz drow@mvista.com
Tue Jun 17 18:19:00 GMT 2003


As suggested by Andrew.  Checking this in, since it was his idea anyway, and
it fixes "break main; run" (as well as lots of other stuff in the testsuite
:)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2003-06-17  Daniel Jacobowitz  <drow@mvista.com>

	* remote.c (remote_prepare_to_store): Replace call to
	deprecated_read_register_bytes with multiple regcache_raw_read
	calls.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.105
diff -u -p -r1.105 remote.c
--- remote.c	10 Jun 2003 14:37:04 -0000	1.105
+++ remote.c	17 Jun 2003 17:22:22 -0000
@@ -3532,16 +3532,19 @@ remote_fetch_registers (int regnum)
 static void
 remote_prepare_to_store (void)
 {
+  struct remote_state *rs = get_remote_state ();
+  int i;
+  char buf[MAX_REGISTER_SIZE];
+
   /* Make sure the entire registers array is valid.  */
   switch (remote_protocol_P.support)
     {
     case PACKET_DISABLE:
     case PACKET_SUPPORT_UNKNOWN:
-      /* NOTE: This isn't rs->sizeof_g_packet because here, we are
-         forcing the register cache to read its and not the target
-         registers.  */
-      deprecated_read_register_bytes (0, (char *) NULL,
-				      DEPRECATED_REGISTER_BYTES); /* OK */
+      /* Make sure all the necessary registers are cached.  */
+      for (i = 0; i < NUM_REGS; i++)
+	if (rs->regs[i].in_g_packet)
+	  regcache_raw_read (current_regcache, rs->regs[i].regnum, buf);
       break;
     case PACKET_ENABLE:
       break;



More information about the Gdb-patches mailing list