From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11491 invoked by alias); 28 Feb 2004 15:17:16 -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 11484 invoked from network); 28 Feb 2004 15:17:14 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.170.238) by sources.redhat.com with SMTP; 28 Feb 2004 15:17:14 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 676D52B92; Sat, 28 Feb 2004 10:17:12 -0500 (EST) Message-ID: <4040B0F8.2050803@gnu.org> Date: Sat, 28 Feb 2004 15:17: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: Mark Kettenis Cc: ac131313@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [rfa/amd64] Zero fill 32-bit registers References: <403E9BC3.2030807@redhat.com> <200402281046.i1SAkhhe000441@elgar.kettenis.dyndns.org> In-Reply-To: <200402281046.i1SAkhhe000441@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00820.txt.bz2 > Date: Thu, 26 Feb 2004 20:22:11 -0500 > From: Andrew Cagney > > 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. > > That's not completely unintentional. The idea is to leave any > "reserved" bits untouched, and in a sense for 32-bit stuff the upper > 32 bits are "reserved"; they are not necessarily zero, at least not > for all registers. Er, the upper 32-bits here aren't reserved. The request was for a 64-bit register, and this code is erreneously only supplying half that value - that leaves the upper 32-bits undefined. We've hit the same problem in the past with the MIPS. When only 32-bits were available the value was expanded (in accordance with the ISA) to the full 64-bits. > I guess the thread code isn't doing the equivalent of the PT_GETREGS > call. I think the correct way to fix this is to make sure the buffer > is properly initialized before you pass it to > amd64_collect_native_gregset. Don't look at me, the buffer originated in libthread-db. > Another problem with your patch is that I'd rather like avoid assuming > that the register buffer is an array of 8-byte registers. That code already assumems that, and that the values are little-endian. Andrew