From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31666 invoked by alias); 29 May 2003 19:05:23 -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 31578 invoked from network); 29 May 2003 19:05:22 -0000 Received: from unknown (HELO zenia.red-bean.com) (12.223.225.216) by sources.redhat.com with SMTP; 29 May 2003 19:05:22 -0000 Received: from zenia.red-bean.com (localhost.localdomain [127.0.0.1]) by zenia.red-bean.com (8.12.5/8.12.5) with ESMTP id h4TJEJFq006124; Thu, 29 May 2003 14:14:19 -0500 Received: (from jimb@localhost) by zenia.red-bean.com (8.12.5/8.12.5/Submit) id h4TJEDU5006120; Thu, 29 May 2003 14:14:13 -0500 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Linux gdbserver: store register values with proper type References: <20030529152950.GA10807@nevyn.them.org> From: Jim Blandy Date: Thu, 29 May 2003 19:05:00 -0000 In-Reply-To: <20030529152950.GA10807@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00550.txt.bz2 Daniel Jacobowitz writes: > This is almost OK. Could you correct the other int reference in the > same block? *duh* How's this? 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