This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Fix non sim builds with sim-regno
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 29 May 2002 12:39:57 -0400
- Subject: [patch] Fix non sim builds with sim-regno
FYI,
I've checked in the attached. It fixes builds for targets that don't
include a simulator (checked against i386-elf and d10v-elf).
Andrew
2002-05-29 Andrew Cagney <ac131313@redhat.com>
* Makefile.in (arch-utils.o): Add $(sim_regno_h).
* arch-utils.c: Include "sim-regno.h".
* gdbarch.sh: Don't include "sim-regno.h".
* gdbarch.h, gdbarch.c: Regenerate.
* sim-regno.h (legacy_register_sim_regno): Move declaration from
here.
* arch-utils.h (legacy_register_sim_regno): To here.
* remote-sim.c (legacy_register_sim_regno): Move function from
here.
* arch-utils.c (legacy_register_sim_regno): To here.
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.201
diff -u -r1.201 Makefile.in
--- Makefile.in 29 May 2002 01:51:15 -0000 1.201
+++ Makefile.in 29 May 2002 16:32:45 -0000
@@ -1586,7 +1586,7 @@
$(arch_utils_h) $(gdb_assert_h) $(inferior_h) \
$(gdb_string_h) $(symtab.h) $(frame_h) $(breakpoint_h) $(gdb_wait_h) \
$(gdbcore_h) $(target_h) $(annotate_h) $(regcache_h) $(gdb_assert_h) \
- $(version_h) $(floatformat_h)
+ $(version_h) $(floatformat_h) $(sim_regno_h)
gdbtypes.o: gdbtypes.c $(bfd_h) $(complaints_h) $(defs_h) $(expression_h) \
$(gdbtypes_h) $(language_h) $(objfiles_h) $(symfile_h) $(symtab_h) \
Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.58
diff -u -r1.58 arch-utils.c
--- arch-utils.c 29 May 2002 01:51:16 -0000 1.58
+++ arch-utils.c 29 May 2002 16:32:45 -0000
@@ -42,6 +42,7 @@
#endif
#include "regcache.h"
#include "gdb_assert.h"
+#include "sim-regno.h"
#include "version.h"
@@ -88,6 +89,22 @@
#endif
*lenptr = 0;
return NULL;
+}
+
+int
+legacy_register_sim_regno (int regnum)
+{
+ /* Only makes sense to supply raw registers. */
+ gdb_assert (regnum >= 0 && regnum < NUM_REGS);
+ /* NOTE: cagney/2002-05-13: The old code did it this way and it is
+ suspected that some GDB/SIM combinations may rely on this
+ behavour. The default should be one2one_register_sim_regno
+ (below). */
+ if (REGISTER_NAME (regnum) != NULL
+ && REGISTER_NAME (regnum)[0] != '\0')
+ return regnum;
+ else
+ return LEGACY_SIM_REGNO_IGNORE;
}
int
Index: arch-utils.h
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.h,v
retrieving revision 1.33
diff -u -r1.33 arch-utils.h
--- arch-utils.h 29 May 2002 01:51:16 -0000 1.33
+++ arch-utils.h 29 May 2002 16:32:45 -0000
@@ -161,6 +161,12 @@
extern void legacy_register_to_value (int regnum, struct type *type, char *from, char *to);
extern void legacy_value_to_register (struct type *type, int regnum, char *from, char *to);
+/* For compatibility with older architectures, returns
+ (LEGACY_SIM_REGNO_IGNORE) when the register doesn't have a valid
+ name. */
+
+extern int legacy_register_sim_regno (int regnum);
+
/* Initialize a ``struct info''. Can't use memset(0) since some
default values are not zero. */
extern void gdbarch_info_init (struct gdbarch_info *info);
Index: gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.128
diff -u -r1.128 gdbarch.c
--- gdbarch.c 29 May 2002 01:51:16 -0000 1.128
+++ gdbarch.c 29 May 2002 16:32:47 -0000
@@ -39,7 +39,6 @@
#if GDB_MULTI_ARCH
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
-#include "sim-regno.h" /* For legacy_register_sim_regno(). */
#else
/* Just include everything in sight so that the every old definition
of macro is visible. */
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.139
diff -u -r1.139 gdbarch.sh
--- gdbarch.sh 29 May 2002 01:51:17 -0000 1.139
+++ gdbarch.sh 29 May 2002 16:32:53 -0000
@@ -759,7 +759,6 @@
/* Pull in function declarations refered to, indirectly, via macros. */
#include "value.h" /* For default_coerce_float_to_double which is referenced by a macro. */
#include "inferior.h" /* For unsigned_address_to_pointer(). */
-#include "sim-regno.h" /* For legacy_register_sim_regno(). */
#endif
struct frame_info;
@@ -1221,7 +1220,6 @@
#if GDB_MULTI_ARCH
#include "gdbcmd.h"
#include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
-#include "sim-regno.h" /* For legacy_register_sim_regno(). */
#else
/* Just include everything in sight so that the every old definition
of macro is visible. */
Index: remote-sim.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sim.c,v
retrieving revision 1.22
diff -u -r1.22 remote-sim.c
--- remote-sim.c 29 May 2002 01:51:17 -0000 1.22
+++ remote-sim.c 29 May 2002 16:32:54 -0000
@@ -279,22 +279,6 @@
}
int
-legacy_register_sim_regno (int regnum)
-{
- /* Only makes sense to supply raw registers. */
- gdb_assert (regnum >= 0 && regnum < NUM_REGS);
- /* NOTE: cagney/2002-05-13: The old code did it this way and it is
- suspected that some GDB/SIM combinations may rely on this
- behavour. The default should be one2one_register_sim_regno
- (below). */
- if (REGISTER_NAME (regnum) != NULL
- && REGISTER_NAME (regnum)[0] != '\0')
- return regnum;
- else
- return LEGACY_SIM_REGNO_IGNORE;
-}
-
-int
one2one_register_sim_regno (int regnum)
{
/* Only makes sense to supply raw registers. */
Index: sim-regno.h
===================================================================
RCS file: /cvs/src/src/gdb/sim-regno.h,v
retrieving revision 1.1
diff -u -r1.1 sim-regno.h
--- sim-regno.h 29 May 2002 01:51:17 -0000 1.1
+++ sim-regno.h 29 May 2002 16:32:54 -0000
@@ -38,11 +38,6 @@
LEGACY_SIM_REGNO_IGNORE = -2
};
-/* For compatibility with older architectures, returns
- (LEGACY_SIM_REGNO_IGNORE) when a register doesn't have. */
-
-extern int legacy_register_sim_regno (int regnum);
-
/* Treat all raw registers as valid. */
extern int one2one_register_sim_regno (int regnum);