This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[RFA] Fix {get|put}_frame_register_bytes


Hi Ulrich,

Looks like there's a bug in the new get_frame_register_bytes() and
put_frame_register_bytes().  I suppose the patch below is what you
intended.

Caught on OpenBSD/powerpc.

ok?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* frame.c (get_frame_register_bytes, put_frame_register_bytes):
	Don't forget to move destination pointer.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.219
diff -u -p -r1.219 frame.c
--- frame.c 11 Jan 2007 17:18:22 -0000 1.219
+++ frame.c 13 Jan 2007 17:28:47 -0000
@@ -775,6 +775,7 @@ get_frame_register_bytes (struct frame_i
 	  memcpy (myaddr, buf + offset, curr_len);
 	}
 
+      myaddr += curr_len;
       len -= curr_len;
       offset = 0;
       regnum++;
@@ -815,6 +816,7 @@ put_frame_register_bytes (struct frame_i
 	  put_frame_register (frame, regnum, buf);
 	}
 
+      myaddr += curr_len;
       len -= curr_len;
       offset = 0;
       regnum++;


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