Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: Linux gdbserver: store register values with proper type
Date: Thu, 29 May 2003 06:19:00 -0000	[thread overview]
Message-ID: <vt24r3efer6.fsf@zenia.red-bean.com> (raw)


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)


             reply	other threads:[~2003-05-29  6:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-29  6:19 Jim Blandy [this message]
2003-05-29 15:29 ` Daniel Jacobowitz
2003-05-29 19:05   ` Jim Blandy
2003-05-29 19:09     ` Daniel Jacobowitz
2003-05-29 23:00       ` Jim Blandy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vt24r3efer6.fsf@zenia.red-bean.com \
    --to=jimb@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox