Recent Linux related changes to gdb...
Kevin Buettner
kevinb@cygnus.com
Sat Sep 11 06:48:00 GMT 1999
On Sep 11, 11:14am, Mark Kettenis wrote:
> I'm not pleased at all that these changes have been merged in. They
> break every non-Linux i386 target. `i386-tdep.c' has been turned into a
> Linux-specific mess (for example the Linux-specific signal trampoline
> handling) and symbols that are only defined in `config/i386/tm-linux.h'
> are used all over the place (LOW_RETURN_REGNUM, HIGH_RETURN_REGNUM,
> FPSTART_REGNUM, FPEND_REGNUM).
>
> I think this is unacceptable, and beg you to revert the patch until
> some care has been taken that it doesn't break all the other i386
> targets, and the linux-specific signal trampoline handling has been
> split-out into a seperate file.
Mark,
With regard to the linux-specific trampoline code, I'll leave it to
Jim Blandy to decide what to do with it. I took a brief look at it
and I don't think it will break other builds. (I'm not responsible
for it being where it is.)
I must claim responsibility for breaking the other builds for the
other i386 targets. Below is a patch that I'd like you (and others)
to try which *should* allow the other i386 targets to build cleanly
again.
I realize that merely ifdefing the code is not the ideal solution,
but I think one of our goals is to unify the i386 floating point
support. Think of this ifdef'd code as a placeholder for what'll
eventually be there after unification has been achieved.
Kevin
Index: i386-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/i386-tdep.c,v
retrieving revision 1.62
diff -u -r1.62 i386-tdep.c
--- i386-tdep.c 1999/09/03 08:14:34 1.62
+++ i386-tdep.c 1999/09/11 13:21:33
@@ -684,13 +684,19 @@
double d;
/* 387 %st(0), gcc uses this */
floatformat_to_double (&floatformat_i387_ext,
- ®buf[REGISTER_BYTE(FPDATA_REGNUM)],
+#if defined(FPDATA_REGNUM)
+ ®buf[REGISTER_BYTE (FPDATA_REGNUM)],
+#else /* !FPDATA_REGNUM */
+ ®buf[REGISTER_BYTE (FP0_REGNUM)],
+#endif /* FPDATA_REGNUM */
+
&d);
store_floating (valbuf, TYPE_LENGTH (type), d);
}
else
#endif /* I386_AIX_TARGET || I386_GNULINUX_TARGET*/
{
+#if defined(LOW_RETURN_REGNUM)
int len = TYPE_LENGTH (type);
int low_size = REGISTER_RAW_SIZE (LOW_RETURN_REGNUM);
int high_size = REGISTER_RAW_SIZE (HIGH_RETURN_REGNUM);
@@ -708,6 +714,9 @@
}
else
error ("GDB bug: i386-tdep.c (i386_extract_return_value): Don't know how to find a return value %d bytes long", len);
+#else /* !LOW_RETURN_REGNUM */
+ memcpy (valbuf, regbuf, TYPE_LENGTH (type));
+#endif /* LOW_RETURN_REGNUM */
}
}
@@ -961,6 +970,7 @@
set_architecture_from_arch_mach (bfd_arch_i386, bfd_mach_i386_i386_intel_syntax);
}
+#if defined(FPSTART_REGNUM)
/* Print the register regnum, or all registers if regnum is -1 */
void
@@ -1005,6 +1015,7 @@
for (i = FPSTART_REGNUM; i < FPEND_REGNUM; i++)
i387_print_register (raw_regs, i);
}
+#endif /* FPSTART_REGNUM */
void
_initialize_i386_tdep ()
Index: i387-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/i387-tdep.c,v
retrieving revision 2.17
diff -u -r2.17 i387-tdep.c
--- i387-tdep.c 1999/09/03 08:15:10 2.17
+++ i387-tdep.c 1999/09/11 13:21:34
@@ -149,6 +149,7 @@
puts_unfiltered ("\n");
}
+#if defined(FPSTART_REGNUM)
void
i387_print_register (raw_regs, regnum)
char *raw_regs;
@@ -287,6 +288,7 @@
for (i = FPSTART_REGNUM; i <= FPEND_REGNUM; i++)
i387_print_register (raw_regs, i);
}
+#endif /* FPSTART_REGNUM */
#ifdef LD_I387
int
More information about the Gdb
mailing list