Date: Fri, 23 Jan 2015 20:40:32 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277608 - head/contrib/gdb/gdb Message-ID: <201501232040.t0NKeWqB086747@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Fri Jan 23 20:40:31 2015 New Revision: 277608 URL: https://svnweb.freebsd.org/changeset/base/277608 Log: MFV r277607: GDB: Fix memset thinkos. 2005-03-25 Anthony Green <green@redhat.com> * remote.c (remote_store_registers): Fix memset usage. * std-regs.c (value_of_builtin_frame_reg): Ditto. (value_of_builtin_frame_fp_reg): Ditto. (value_of_builtin_frame_reg): Ditto. Reported by: Dirk Engling CID: 604160, 604161, 604162, 604163 MFC after: 5 days Modified: head/contrib/gdb/gdb/remote.c head/contrib/gdb/gdb/std-regs.c Directory Properties: head/contrib/gdb/ (props changed) Modified: head/contrib/gdb/gdb/remote.c ============================================================================== --- head/contrib/gdb/gdb/remote.c Fri Jan 23 20:32:19 2015 (r277607) +++ head/contrib/gdb/gdb/remote.c Fri Jan 23 20:40:31 2015 (r277608) @@ -3463,7 +3463,7 @@ remote_store_registers (int regnum) { int i; regs = alloca (rs->sizeof_g_packet); - memset (regs, rs->sizeof_g_packet, 0); + memset (regs, 0, rs->sizeof_g_packet); for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++) { struct packet_reg *r = &rs->regs[i]; Modified: head/contrib/gdb/gdb/std-regs.c ============================================================================== --- head/contrib/gdb/gdb/std-regs.c Fri Jan 23 20:32:19 2015 (r277607) +++ head/contrib/gdb/gdb/std-regs.c Fri Jan 23 20:40:31 2015 (r277608) @@ -61,7 +61,7 @@ value_of_builtin_frame_reg (struct frame val = allocate_value (builtin_type_frame_reg); VALUE_LVAL (val) = not_lval; buf = VALUE_CONTENTS_RAW (val); - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); /* frame.base. */ if (frame != NULL) ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, @@ -87,7 +87,7 @@ value_of_builtin_frame_fp_reg (struct fr struct value *val = allocate_value (builtin_type_void_data_ptr); char *buf = VALUE_CONTENTS_RAW (val); if (frame == NULL) - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); else ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, get_frame_base_address (frame)); @@ -105,7 +105,7 @@ value_of_builtin_frame_pc_reg (struct fr struct value *val = allocate_value (builtin_type_void_data_ptr); char *buf = VALUE_CONTENTS_RAW (val); if (frame == NULL) - memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0); + memset (buf, 0, TYPE_LENGTH (VALUE_TYPE (val))); else ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, get_frame_pc (frame));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501232040.t0NKeWqB086747>