Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] sim: Update sim_{fetch,store}_register for sh and mn10300
@ 2012-02-16  0:27 Kevin Buettner
  2012-02-16 10:38 ` Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2012-02-16  0:27 UTC (permalink / raw)
  To: gdb-patches

The patch below updates sim_fetch_register for both mn10300 and sh
to return the length of the value being fetched instead of -1.  For
sh, sim_store_register() is changed in a like fashion.

This change is necessary due to past changes to remote-sim.c which do
more stringent checks of the return value.

Comments?

sim/mn10300/ChangeLog:

	* interp.c (sim_fetch_register): Return length, not -1.

sim/ChangeLog:

	* sh/interp.c (sim_store_register, sim_fetch_register): Return
	length, not -1.


Index: sim/mn10300/interp.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/interp.c,v
retrieving revision 1.7
diff -u -p -r1.7 interp.c
--- sim/mn10300/interp.c	5 Jul 2011 19:06:38 -0000	1.7
+++ sim/mn10300/interp.c	15 Feb 2012 23:59:49 -0000
@@ -383,7 +383,7 @@ sim_fetch_register (SIM_DESC sd,
 		    int length)
 {
   put_word (memory, State.regs[rn]);
-  return -1;
+  return length;
 }
  
 int
Index: sim/sh/interp.c
===================================================================
RCS file: /cvs/src/src/sim/sh/interp.c,v
retrieving revision 1.23
diff -u -p -r1.23 interp.c
--- sim/sh/interp.c	16 Apr 2011 18:16:36 -0000	1.23
+++ sim/sh/interp.c	15 Feb 2012 23:59:49 -0000
@@ -2356,7 +2356,7 @@ sim_store_register (sd, rn, memory, leng
     default:
       return 0;
     }
-  return -1;
+  return length;
 }
 
 int
@@ -2531,7 +2531,7 @@ sim_fetch_register (sd, rn, memory, leng
       return 0;
     }
   * (int *) memory = swap (val);
-  return -1;
+  return length;
 }
 
 int


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

end of thread, other threads:[~2012-02-16 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16  0:27 [RFC] sim: Update sim_{fetch,store}_register for sh and mn10300 Kevin Buettner
2012-02-16 10:38 ` Mike Frysinger
2012-02-16 23:40   ` Kevin Buettner

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