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]
Other format: [Raw text]

RFA: Linux gdbserver: store register values with proper type


2003-05-29  Jim Blandy  <jimb@redhat.com>

	* linux-low.c (usr_store_inferior_registers): Transfer buf in
	PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
	if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
	away part of the register's value.

Index: gdb/gdbserver/linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.21
diff -c -r1.21 linux-low.c
*** gdb/gdbserver/linux-low.c	26 Mar 2003 16:36:41 -0000	1.21
--- gdb/gdbserver/linux-low.c	29 May 2003 06:15:58 -0000
***************
*** 976,982 ****
  	{
  	  errno = 0;
  	  ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
! 		  *(int *) (buf + i));
  	  if (errno != 0)
  	    {
  	      if ((*the_low_target.cannot_store_register) (regno) == 0)
--- 976,982 ----
  	{
  	  errno = 0;
  	  ptrace (PTRACE_POKEUSER, inferior_pid, (PTRACE_ARG3_TYPE) regaddr,
! 		  *(PTRACE_XFER_TYPE *) (buf + i));
  	  if (errno != 0)
  	    {
  	      if ((*the_low_target.cannot_store_register) (regno) == 0)


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