From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5453 invoked by alias); 27 Feb 2004 01:22:15 -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 5438 invoked from network); 27 Feb 2004 01:22:14 -0000 Received: from unknown (HELO localhost.redhat.com) (216.129.200.20) by sources.redhat.com with SMTP; 27 Feb 2004 01:22:14 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B4EC92B92 for ; Thu, 26 Feb 2004 20:22:11 -0500 (EST) Message-ID: <403E9BC3.2030807@redhat.com> Date: Fri, 27 Feb 2004 01:22:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.4.1) Gecko/20040217 MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa/amd64] Zero fill 32-bit registers Content-Type: multipart/mixed; boundary="------------000306030801020306030601" X-SW-Source: 2004-02/txt/msg00793.txt.bz2 This is a multi-part message in MIME format. --------------000306030801020306030601 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 301 Hello, For a 64-bit gregset, the code was only modifying the low 32-bits of the register field - leaving the upper 64-bits undefined. This, among other things, would lead to mysterious 32-bit thread failures. The attached ensures that the upper part of each fetched register is zero. ok? Andrew --------------000306030801020306030601 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1710 2004-02-25 Andrew Cagney * amd64-nat.c: Include "gdb_string.h". (amd64_collect_native_gregset): Zero fill the register. * Makefile.in: Update dependencies. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.517 diff -u -r1.517 Makefile.in --- Makefile.in 26 Feb 2004 23:48:01 -0000 1.517 +++ Makefile.in 27 Feb 2004 01:19:15 -0000 @@ -1536,7 +1536,7 @@ $(regcache_h) $(osabi_h) $(gdb_string_h) $(amd64_tdep_h) \ $(amd64_linux_tdep_h) amd64-nat.o: amd64-nat.c $(defs_h) $(gdbarch_h) $(regcache_h) \ - $(gdb_assert_h) $(i386_tdep_h) $(amd64_tdep_h) + $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) $(amd64_tdep_h) amd64nbsd-nat.o: amd64nbsd-nat.c $(defs_h) $(gdb_assert_h) $(amd64_tdep_h) \ $(amd64_nat_h) amd64nbsd-tdep.o: amd64nbsd-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) \ Index: amd64-nat.c =================================================================== RCS file: /cvs/src/src/gdb/amd64-nat.c,v retrieving revision 1.4 diff -u -r1.4 amd64-nat.c --- amd64-nat.c 25 Feb 2004 20:59:12 -0000 1.4 +++ amd64-nat.c 27 Feb 2004 01:19:15 -0000 @@ -24,6 +24,7 @@ #include "regcache.h" #include "gdb_assert.h" +#include "gdb_string.h" #include "i386-tdep.h" #include "amd64-tdep.h" @@ -140,7 +141,12 @@ int offset = amd64_native_gregset_reg_offset (i); if (offset != -1) - regcache_raw_collect (regcache, i, regs + offset); + { + regcache_raw_collect (regcache, i, regs + offset); + if (register_size (gdbarch, i) < 8) + memset (regs + offset + register_size (gdbarch, i), + 0, 8 - register_size (gdbarch, i)); + } } } } --------------000306030801020306030601--