[RFA/RFC] Fix build failure on mips-irix (mips-tdep.c)
Joel Brobecker
brobecker@gnat.com
Sat Jul 5 04:00:00 GMT 2003
Andrew,
GDB currently does not build on our IRIX machine (IRIX 6.5). It's
because it does not find the MIPS_REGISTER_TYPE macro. I think it is
just an oversight of one of your previous patches
http://sources.redhat.com/ml/gdb-patches/2003-06/msg00676.html
The following is an attempt at fixing this problem, but I'm not sure it
is really the right way of doing it. Could you tell me what you think?
2003-07-04 Joel Brobecker <brobecker@gnat.com>
* mips-tdep.c (mips_register_raw_size): Fix compilation failure.
(mips_register_byte): Likewise.
Also, I get an unusually high number of FAILs (close to 2000). Some of
them are probably caused by the fact that we don't have a C++ compiler
installed on our machine, but that does not explain the bulk of these
regressions. I am hoping this high number of fails is because my patch
is actually wrong... :-/ Otherwise, I'll dig in the log files, and try
to analyze the regressions.
Thanks,
--
Joel
-------------- next part --------------
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.222
diff -u -p -r1.222 mips-tdep.c
--- mips-tdep.c 26 Jun 2003 18:01:58 -0000 1.222
+++ mips-tdep.c 5 Jul 2003 03:48:07 -0000
@@ -50,6 +50,7 @@
#include "sim-regno.h"
static void set_reg_offset (CORE_ADDR *saved_regs, int regnum, CORE_ADDR off);
+static struct type *mips_register_type (struct gdbarch *gdbarch, int regnum);
/* A useful bit in the CP0 status register (PS_REGNUM). */
/* This bit is set if we are emulating 32-bit FPRs on a 64-bit chip. */
@@ -670,7 +671,7 @@ mips_register_raw_size (int regnum)
/* For the moment map [NUM_REGS .. 2*NUM_REGS) onto the same raw
registers, but always return the virtual size. */
int rawnum = regnum % NUM_REGS;
- return TYPE_LENGTH (MIPS_REGISTER_TYPE (rawnum));
+ return TYPE_LENGTH (gdbarch_register_type (current_gdbarch, rawnum));
}
else
internal_error (__FILE__, __LINE__, "Register %d out of range", regnum);
@@ -700,7 +701,8 @@ mips_register_byte (int regnum)
/* Add space for all the proceeding registers based on their
real size. */
for (reg = NUM_REGS; reg < regnum; reg++)
- byte += TYPE_LENGTH (MIPS_REGISTER_TYPE ((reg % NUM_REGS)));
+ byte += TYPE_LENGTH (gdbarch_register_type (current_gdbarch,
+ (reg % NUM_REGS)));
return byte;
}
else
More information about the Gdb-patches
mailing list