From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11989 invoked by alias); 29 May 2003 19:09:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 11937 invoked from network); 29 May 2003 19:09:45 -0000 Received: from unknown (HELO crack.them.org) (146.82.138.56) by sources.redhat.com with SMTP; 29 May 2003 19:09:45 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 19LSn1-0004B1-00; Thu, 29 May 2003 14:10:21 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19LSmN-00075P-00; Thu, 29 May 2003 15:09:35 -0400 Date: Thu, 29 May 2003 19:09:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Linux gdbserver: store register values with proper type Message-ID: <20030529190934.GA27223@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <20030529152950.GA10807@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-05/txt/msg00551.txt.bz2 On Thu, May 29, 2003 at 02:14:13PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > This is almost OK. Could you correct the other int reference in the > > same block? > > *duh* > > How's this? Good by me, go ahead. > > gdbserver/ChangeLog: > 2003-05-29 Jim Blandy > > * 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.14.2 > diff -c -r1.21.14.2 linux-low.c > *** gdb/gdbserver/linux-low.c 29 May 2003 19:01:10 -0000 1.21.14.2 > --- gdb/gdbserver/linux-low.c 29 May 2003 19:02:52 -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) > *************** > *** 989,995 **** > return; > } > } > ! regaddr += sizeof (int); > } > } > else > --- 989,995 ---- > return; > } > } > ! regaddr += sizeof (PTRACE_XFER_TYPE); > } > } > else > -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer