From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20874 invoked by alias); 28 Feb 2004 10:46:59 -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 20866 invoked from network); 28 Feb 2004 10:46:57 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 28 Feb 2004 10:46:57 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i1SAkmoq000246; Sat, 28 Feb 2004 11:46:48 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i1SAklbh000444; Sat, 28 Feb 2004 11:46:47 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i1SAkhhe000441; Sat, 28 Feb 2004 11:46:43 +0100 (CET) Date: Sat, 28 Feb 2004 10:46:00 -0000 Message-Id: <200402281046.i1SAkhhe000441@elgar.kettenis.dyndns.org> From: Mark Kettenis To: ac131313@redhat.com CC: gdb-patches@sources.redhat.com In-reply-to: <403E9BC3.2030807@redhat.com> (message from Andrew Cagney on Thu, 26 Feb 2004 20:22:11 -0500) Subject: Re: [rfa/amd64] Zero fill 32-bit registers References: <403E9BC3.2030807@redhat.com> X-SW-Source: 2004-02/txt/msg00817.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. To prevent the upper 32 bits being "undefined", typical usage of these functions is: ptrace (PT_GETREGS, ..., ®s, 0); amd64_collect_native_gregset (current_regcache, ®s, regnum); ptrace (PT_SETREGS, ..., ®s, 0); This, among other things, would lead to mysterious 32-bit thread failures. 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. Another problem with your patch is that I'd rather like avoid assuming that the register buffer is an array of 8-byte registers. Mark