aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/gdbarch.c40
-rw-r--r--gdb/gdbarch.h14
-rwxr-xr-xgdb/gdbarch.sh1
-rw-r--r--gdb/infcmd.c11
-rw-r--r--gdb/inferior.h2
6 files changed, 66 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e6e4a40..acf734f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2000-08-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdbarch.sh: Multiarch DO_REGISTERS_INFO macro.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * infcmd.c (do_registers_info): Make not static and
+ unconditionalize.
+ * inferior.h (do_registers_info): Export.
+
2000-08-01 Kazu Hirata <kazu@hxi.com>
* MAINTAINERS: Add myself to "Write After Approval" list.
@@ -79,6 +87,8 @@ Tue Aug 1 14:50:55 2000 Andrew Cagney <cagney@b1.cygnus.com>
2000-07-31 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+ * sh-tdep.c (sh_push_arguments): Make header match prototype.
+
* remote-e7000.c (e7000_start_remote): Use void *, not char * as
parameter to avoid compiler warning.
(fetch_regs_from_dump): Call get_hex() with the correct number of
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index a32eafa..9aaf91a 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -161,6 +161,7 @@ struct gdbarch
gdbarch_register_virtual_size_ftype *register_virtual_size;
int max_register_virtual_size;
gdbarch_register_virtual_type_ftype *register_virtual_type;
+ gdbarch_do_registers_info_ftype *do_registers_info;
int use_generic_dummy_frames;
int call_dummy_location;
gdbarch_call_dummy_address_ftype *call_dummy_address;
@@ -296,6 +297,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
generic_get_saved_register,
0,
0,
@@ -381,6 +383,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->register_bytes = -1;
gdbarch->max_register_raw_size = -1;
gdbarch->max_register_virtual_size = -1;
+ gdbarch->do_registers_info = do_registers_info;
gdbarch->use_generic_dummy_frames = -1;
gdbarch->call_dummy_start_offset = -1;
gdbarch->call_dummy_breakpoint_offset = -1;
@@ -523,6 +526,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_virtual_type == 0))
internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid");
+ /* Skip verify of do_registers_info, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 1)
&& (gdbarch->use_generic_dummy_frames == -1))
internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid");
@@ -869,6 +873,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"REGISTER_VIRTUAL_TYPE(reg_nr)",
XSTRING (REGISTER_VIRTUAL_TYPE (reg_nr)));
#endif
+#if defined (DO_REGISTERS_INFO) && GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DO_REGISTERS_INFO(reg_nr, fpregs)",
+ XSTRING (DO_REGISTERS_INFO (reg_nr, fpregs)));
+#endif
#ifdef USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
@@ -1466,6 +1477,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->register_virtual_type
/*REGISTER_VIRTUAL_TYPE ()*/);
#endif
+#ifdef DO_REGISTERS_INFO
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DO_REGISTERS_INFO = 0x%08lx\n",
+ (long) current_gdbarch->do_registers_info
+ /*DO_REGISTERS_INFO ()*/);
+#endif
#ifdef USE_GENERIC_DUMMY_FRAMES
fprintf_unfiltered (file,
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
@@ -2483,6 +2501,23 @@ set_gdbarch_register_virtual_type (struct gdbarch *gdbarch,
gdbarch->register_virtual_type = register_virtual_type;
}
+void
+gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs)
+{
+ if (gdbarch->do_registers_info == 0)
+ internal_error ("gdbarch: gdbarch_do_registers_info invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n");
+ gdbarch->do_registers_info (reg_nr, fpregs);
+}
+
+void
+set_gdbarch_do_registers_info (struct gdbarch *gdbarch,
+ gdbarch_do_registers_info_ftype do_registers_info)
+{
+ gdbarch->do_registers_info = do_registers_info;
+}
+
int
gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
{
@@ -3693,7 +3728,8 @@ init_gdbarch_data (struct gdbarch *gdbarch)
data-pointer. */
void *
-gdbarch_data (struct gdbarch_data *data)
+gdbarch_data (data)
+ struct gdbarch_data *data;
{
if (data->index >= current_gdbarch->nr_data)
internal_error ("gdbarch_data: request for non-existant data.");
@@ -4085,7 +4121,7 @@ disassemble_info tm_print_insn_info;
extern void _initialize_gdbarch (void);
void
-_initialize_gdbarch (void)
+_initialize_gdbarch ()
{
struct cmd_list_element *c;
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index f78db27..2077048 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -396,6 +396,20 @@ extern void set_gdbarch_register_virtual_type (struct gdbarch *gdbarch, gdbarch_
#endif
#endif
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (DO_REGISTERS_INFO)
+#define DO_REGISTERS_INFO(reg_nr, fpregs) (do_registers_info (reg_nr, fpregs))
+#endif
+
+typedef void (gdbarch_do_registers_info_ftype) (int reg_nr, int fpregs);
+extern void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs);
+extern void set_gdbarch_do_registers_info (struct gdbarch *gdbarch, gdbarch_do_registers_info_ftype *do_registers_info);
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DO_REGISTERS_INFO)
+#define DO_REGISTERS_INFO(reg_nr, fpregs) (gdbarch_do_registers_info (current_gdbarch, reg_nr, fpregs))
+#endif
+#endif
+
extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
#if GDB_MULTI_ARCH
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 36ae199..c8caa94 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -341,6 +341,7 @@ v:2:MAX_REGISTER_RAW_SIZE:int:max_register_raw_size::::0:-1
f:2:REGISTER_VIRTUAL_SIZE:int:register_virtual_size:int reg_nr:reg_nr::0:0
v:2:MAX_REGISTER_VIRTUAL_SIZE:int:max_register_virtual_size::::0:-1
f:2:REGISTER_VIRTUAL_TYPE:struct type *:register_virtual_type:int reg_nr:reg_nr::0:0
+f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpregs:::do_registers_info::0
#
v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1
v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index bbe1a7c..946725b 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -72,10 +72,6 @@ static void detach_command (char *, int);
static void interrupt_target_command (char *args, int from_tty);
-#if !defined (DO_REGISTERS_INFO)
-static void do_registers_info (int, int);
-#endif
-
static void unset_environment_command (char *, int);
static void set_environment_command (char *, int);
@@ -1445,11 +1441,7 @@ char *gdb_register_names[] = REGISTER_NAMES;
all the registers, define the macro DO_REGISTERS_INFO(regnum, fp)
to provide that format. */
-#if !defined (DO_REGISTERS_INFO)
-
-#define DO_REGISTERS_INFO(regnum, fp) do_registers_info(regnum, fp)
-
-static void
+void
do_registers_info (int regnum, int fpregs)
{
register int i;
@@ -1552,7 +1544,6 @@ do_registers_info (int regnum, int fpregs)
printf_filtered ("\n");
}
}
-#endif /* no DO_REGISTERS_INFO. */
void
registers_info (char *addr_exp, int fpregs)
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 0281d24..4c91e83 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -186,6 +186,8 @@ extern void resume (int, enum target_signal);
/* From misc files */
+extern void do_registers_info (int, int);
+
extern void store_inferior_registers (int);
extern void fetch_inferior_registers (int);