This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Cross target core debugging: host=i386, Target=PPC
- From: Martin Gadbois <martin dot gadbois at colubris dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 30 Jul 2002 08:51:30 -0400
- Subject: Re: [PATCH] Cross target core debugging: host=i386, Target=PPC
- Organization: Colubris Networks Inc.
- References: <3D45ACCC.9040803@colubris.com> <1020729215359.ZM11339@localhost.localdomain>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kevin Buettner wrote:
| 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?
It seems that gregset.h is included by core-regset.c and ppc-linux-tdep.c.
Looks to me that core-regset.c is not arch/cpu dependent... I should not put the elf_gregset_t in
that .c file.
Should I copy asm/elf.h from the PPC distro and included it as elf-ppc.h?
I am not so sure how the arch/cpu is handled in GDB..., so how can I include a generic elf-<TARGET>.h?
- --
==============
Martin Gadbois
S/W Developper
Colubris Networks Inc.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAj1Gi9EACgkQ9Y3/iTTCEDlAhACgpco7HtbmlpDIIxhDczsEn2kr
9qAAnjBM/R0pu5vc5+qqUhEvN9p9JjZh
=xBR0
-----END PGP SIGNATURE-----