From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4765 invoked by alias); 29 Jul 2002 21:54:37 -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 4700 invoked from network); 29 Jul 2002 21:54:05 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 29 Jul 2002 21:54:05 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g6TLfss09416 for ; Mon, 29 Jul 2002 17:41:54 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g6TLs2u17349; Mon, 29 Jul 2002 17:54:03 -0400 Received: from romulus.sfbay.redhat.com (IDENT:9yss159pYRMHS7Pj12AUqRBjTC6vzahh@romulus.sfbay.redhat.com [172.16.27.251]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g6TLs1j20488; Mon, 29 Jul 2002 14:54:02 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g6TLrxD11340; Mon, 29 Jul 2002 14:53:59 -0700 Date: Mon, 29 Jul 2002 14:59:00 -0000 From: Kevin Buettner Message-Id: <1020729215359.ZM11339@localhost.localdomain> In-Reply-To: Martin Gadbois "[PATCH] Cross target core debugging: host=i386, Target=PPC" (Jul 29, 4:59pm) References: <3D45ACCC.9040803@colubris.com> To: Martin Gadbois , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Cross target core debugging: host=i386, Target=PPC MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-07/txt/msg00563.txt.bz2 On Jul 29, 4:59pm, Martin Gadbois wrote: > diff -Naur gdb-5.2/gdb/gregset.h gdb-5.2-ppc-core/gdb/gregset.h > --- gdb-5.2/gdb/gregset.h Sun Feb 24 17:14:33 2002 > +++ gdb-5.2-ppc-core/gdb/gregset.h Mon Jul 29 15:45:43 2002 > @@ -21,6 +21,20 @@ > #ifndef GREGSET_H > #define GREGSET_H > > + > +#define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ > +#define ELF_NFPREG 33 /* includes fpscr */ > +#define ELF_NVRREG 33 /* includes vscr */ > + > +typedef unsigned long elf_greg_t; > +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; > + > +typedef double elf_fpreg_t; > +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; > + > +#define GDB_GREGSET_T elf_gregset_t > +#define GDB_FPREGSET_T elf_fpregset_t > + > #ifndef GDB_GREGSET_T > #define GDB_GREGSET_T gregset_t > #endif This part will need some work. (The other parts might too; I haven't looked closely at them yet.) Anyway, there are several problems here... 1) The constants ELF_NGREG, ELF_NFPREG, ELF_NVRREG will almost certainly be incorrect for other targets. 2) Defining elf_greg_t in terms of a long isn't portable. 3) Likewise, for elf_fpreg_t being defined in terms of a double. For #1, why do these constants need to be put into a header file at all. Couldn't this knowledge be localized in the portion of the .c file responsible for decoding the core format? For #2 and #3, I think it's reasonably portable to define your data types in terms of arrays of characters. (Or perhaps in terms of structs containing arrays of characters. The struct representation is perhaps more convenient in certain situations.) Kevin