From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29069 invoked by alias); 13 Aug 2002 22:06:26 -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 29061 invoked from network); 13 Aug 2002 22:06:25 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.250) by sources.redhat.com with SMTP; 13 Aug 2002 22:06:25 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g7DM6MSx000475; Wed, 14 Aug 2002 00:06:22 +0200 (CEST) (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.5/8.12.5) with ESMTP id g7DM6NL0034809; Wed, 14 Aug 2002 00:06:23 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.5/8.12.5/Submit) id g7DM6IOV034806; Wed, 14 Aug 2002 00:06:18 +0200 (CEST) Date: Tue, 13 Aug 2002 15:06:00 -0000 Message-Id: <200208132206.g7DM6IOV034806@elgar.kettenis.dyndns.org> From: Mark Kettenis To: brobecker@gnat.com CC: gdb-patches@sources.redhat.com In-reply-to: <20020807010426.GN916@gnat.com> (message from Joel Brobecker on Tue, 6 Aug 2002 18:04:26 -0700) Subject: Re: Question regarding i386v4-nat.c:supply_gregset and fill_gregset References: <20020807010426.GN916@gnat.com> X-SW-Source: 2002-08/txt/msg00327.txt.bz2 Date: Tue, 6 Aug 2002 18:04:26 -0700 From: Joel Brobecker Hello Mark, Sorry for the slow response. I was having a vacation :-). 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. Hmm... 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. Yup, it is as Daniel already explained. 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? That would be a valid approach (although I would name the functions i386_supply_gregs and i386_fill_gregs). On the other hand, I wouldn't object to duplicating the small bits of code for Interix and deal with it later. I'll have to rethink these functions sooner or later if I want to support cross-debugging of core files. Mark