From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15099 invoked by alias); 7 Aug 2002 13:16:31 -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 15073 invoked from network); 7 Aug 2002 13:16:30 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 7 Aug 2002 13:16:30 -0000 Received: from dsl254-114-118.nyc1.dsl.speakeasy.net ([216.254.114.118] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17cQfd-00051F-00; Wed, 07 Aug 2002 08:16:13 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17cQft-0008Hl-00; Wed, 07 Aug 2002 09:16:29 -0400 Date: Wed, 07 Aug 2002 06:16:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: Mark Kettenis , gdb-patches@sources.redhat.com Subject: Re: Question regarding i386v4-nat.c:supply_gregset and fill_gregset Message-ID: <20020807131629.GA31703@nevyn.them.org> Mail-Followup-To: Joel Brobecker , Mark Kettenis , gdb-patches@sources.redhat.com References: <20020807010426.GN916@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020807010426.GN916@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-08/txt/msg00158.txt.bz2 On Tue, Aug 06, 2002 at 06:04:26PM -0700, Joel Brobecker wrote: > Hello Mark, > > Following your suggestion to use i386v4-nat.c for the interix port, > I was indeed impressed to see that, after simplifying supply_gregset() > and fill_gregset() as you indicated, they become (almost identical) to > their counterpart in i386v4-nat. > > But there is one difference that causes some grief on interix, and I > had to modify these 2 functions like this to make them to work for > interix: > > - greg_t *regp = (greg_t *) gregsetp; > + greg_t *regp = (greg_t *) & gregsetp->gregs; > > Indeed, on Interix, the gregs buffer is not located at the begining > of the gregset_t structure. So the function were reading/writting at > the wrong location. > > The trouble is I don't have any machine handy to verify this change > on the other platforms. I have the feeling, though, that type gregset_t > is not always a structure, and hence makes my change only valid for > interix. If this is the case, then I am afraid we won't be able to reuse > i386v4-nat.c that easily. Maybe we should implement 2 new functions > similar to i387_supply_fsave and i387_fill_fsave (in i386-nat.[hc]?): > > i386_supply_gregset (greg_t *gregp); > i386_fill_gregset (greg_t *gregp, int regno); > > both i386v4-nat.c and i386-interix-nat.c would use them to implement > supply/fill_gregset. > > What do you think? I'm inclined to agree with you. gregset_t is supposed to be an array; it traditionally has been, in various Unices, and there's some comments in the Linux headers to the affect that we needed to leave it that way to prevent confusing certain software (GDB not least among it). If Interix does it differently you will need to have some separate code path. Of course, if someone were to multi-arch supply_gregset, we could use this convenient OSABI mechanism... -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer