From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24932 invoked by alias); 28 Feb 2004 20:40:07 -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 24925 invoked from network); 28 Feb 2004 20:40:06 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.170.238) by sources.redhat.com with SMTP; 28 Feb 2004 20:40:06 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0E5EC2B92; Sat, 28 Feb 2004 15:39:48 -0500 (EST) Message-ID: <4040FC93.9000100@gnu.org> Date: Sat, 28 Feb 2004 20:40: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> <4040B0F8.2050803@gnu.org> <200402281734.i1SHYvol017921@elgar.kettenis.dyndns.org> <4040E96F.4010809@gnu.org> <200402282025.i1SKPdRr000430@elgar.kettenis.dyndns.org> In-Reply-To: <200402282025.i1SKPdRr000430@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-02/txt/msg00859.txt.bz2 > It doesn't address the underlying problem where fetching an individual > register leaves half the register field undefined. The code shouldn't > assume that other code has magically initialized the rest of that > register field. > > OK, but you realize its the problem of the threads code, and *not* the > code amd64-nat.c? Both are broken - "society is to blame". > > > 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. > > > > Yes it assumes little-endianness, but the assumptions on the size of > > the slots in the register buffer are weaker. The register buffer here > > corresponds to `struct reg' on the BSD's. It would be prefectly well > > possible for some of its members to be 4 bytes in size. The current > > code works for that case, whereas with your patch, it could thrash > > another member of the structure. > > Do you know of any such an system? > > Actually GNU/Linux x86-64 has a gregset_t where %cs, %fs and %gs are > stored in a short. > > Could you live with just zero-extending the 16 general-purpose > registers and the instruction pointer? I'll implement it for you. It is certainly an improvement! Can you test it? Andrew