1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
This patch was contributed by Daniel Simon of the U of Stuttgart. It
allows building gnat-gdb on sparc-sun-linux. Here is what Daniel
says:
> is there a reason for not having a gnat-gdb on Debian/Sparc?
>
> Yesterday, I downloaded the source package for gnat-gdb and built a
> binary package. It almost compiled without intervention; I had to
> modify one file of the package (replace an included system header by
> its contents, commenting out parts of the contents. I don't actually
> understand what gcc wants from me.)
>
> If you are interested, I can mail you the modified sources.
I amended Daniel's patch to make it minimal.
For more details, see Debian bugs #274694, #274906 and #287484.
--
Ludovic Brenta, 2005-01-18.
--- gdb/sparc-nat.c~ Thu Jan 16 10:47:09 2003
+++ gdb/sparc-nat.c Thu Nov 18 10:34:09 2004
@@ -34,5 +34,49 @@
#include <sys/wait.h>
#ifdef __linux__
-#include <asm/reg.h>
+struct regs {
+ int r_psr;
+#define r_ps r_psr
+ int r_pc;
+ int r_npc;
+ int r_y;
+ int r_g1;
+ int r_g2;
+ int r_g3;
+ int r_g4;
+ int r_g5;
+ int r_g6;
+ int r_g7;
+ int r_o0;
+ int r_o1;
+ int r_o2;
+ int r_o3;
+ int r_o4;
+ int r_o5;
+ int r_o6;
+ int r_o7;
+};
+
+#define FPU_FSR_TYPE unsigned
+
+struct fp_status {
+ union {
+ FPU_REGS_TYPE Fpu_regs[32];
+ double Fpu_dregs[16];
+ } fpu_fr;
+ FPU_FSR_TYPE Fpu_fsr;
+ unsigned Fpu_flags;
+ unsigned Fpu_extra;
+ unsigned Fpu_qcnt;
+ struct fq Fpu_q[16];
+};
+
+#define fpu_regs f_fpstatus.fpu_fr.Fpu_regs
+#define fpu_dregs f_fpstatus.fpu_fr.Fpu_dregs
+#define fpu_fsr f_fpstatus.Fpu_fsr
+#define fpu_flags f_fpstatus.Fpu_flags
+#define fpu_extra f_fpstatus.Fpu_extra
+#define fpu_q f_fpstatus.Fpu_q
+#define fpu_qcnt f_fpstatus.Fpu_qcnt
+
#else
#include <machine/reg.h>
@@ -333,20 +378,4 @@
}
}
- else if (which == 2)
- {
-
- /* Floating point registers */
-
-#define fpuregs ((struct fpu *) core_reg_sect)
- if (core_reg_size >= sizeof (struct fpu))
- {
- memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fpuregs->fpu_regs,
- sizeof (fpuregs->fpu_regs));
- memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
- sizeof (FPU_FSR_TYPE));
- }
- else
- fprintf_unfiltered (gdb_stderr, "Couldn't read float regs from core file\n");
- }
}
|