summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-06-28 23:19:26 +0000
committerAndrew Cagney <cagney@redhat.com>2002-06-28 23:19:26 +0000
commit8416be83ad875e64f064faa31c9beb6090e6b53b (patch)
treee554f0c02b9f9ab6be3d2c6ddc1a6acdd41a46ce
parenteff714fb3aa04df9514ba62c835ba075df664244 (diff)
downloadgdb-8416be83ad875e64f064faa31c9beb6090e6b53b.tar.gz
merge with trunk
-rw-r--r--gdb/Makefile.in9
-rw-r--r--gdb/abug-rom.c23
-rw-r--r--gdb/arch-utils.c16
-rw-r--r--gdb/blockframe.c28
-rw-r--r--gdb/breakpoint.c2
-rw-r--r--gdb/command.h20
-rw-r--r--gdb/cpu32bug-rom.c23
-rw-r--r--gdb/cris-tdep.c2
-rw-r--r--gdb/dbug-rom.c27
-rw-r--r--gdb/frame.h8
-rw-r--r--gdb/m68k-tdep.c24
-rw-r--r--gdb/monitor.c13
-rw-r--r--gdb/monitor.h3
-rw-r--r--gdb/objfiles.h2
-rw-r--r--gdb/ppcnbsd-tdep.c2
-rw-r--r--gdb/regcache.c3
-rw-r--r--gdb/remote-est.c25
-rw-r--r--gdb/rom68k-rom.c24
-rw-r--r--gdb/rs6000-tdep.c11
-rw-r--r--gdb/s390-tdep.c4
-rw-r--r--gdb/sh-tdep.c10
-rw-r--r--gdb/symtab.h1
-rw-r--r--gdb/vax-tdep.c65
-rw-r--r--gdb/vax-tdep.h8
-rw-r--r--gdb/version.in2
25 files changed, 263 insertions, 92 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 29e7060390c..ef35cccdb1d 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -641,7 +641,7 @@ macrotab_h = macrotab.h $(obstack_h) $(bcache_h)
macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
memattr_h = memattr.h
monitor_h = monitor.h
-objfiles_h = objfiles.h
+objfiles_h = objfiles.h $(bcache_h)
parser_defs_h = parser-defs.h $(doublest_h)
ppc_tdep_h = ppc-tdep.h osabi.h
regcache_h = regcache.h
@@ -655,7 +655,7 @@ solist_h = solist.h
source_h = source.h
stabsread_h = stabsread.h
symfile_h = symfile.h
-symtab_h = symtab.h $(bcache_h)
+symtab_h = symtab.h
target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
terminal_h = terminal.h
top_h = top.h
@@ -665,6 +665,7 @@ ui_out_h = ui-out.h
valprint_h = valprint.h
value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) $(doublest_h)
varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
+vax_tdep_h = vax-tdep.h osabi.h
version_h = version.h
wrapper_h = wrapper.h
xcoffsolib_h = xcoffsolib.h
@@ -875,7 +876,7 @@ init.c: $(INIT_FILES)
-e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \
while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \
sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' | \
- ( echo _initialize_gdbtypes ; grep -v -e '^_initialize_gdbtypes$$' ) > init.l-tmp
+ ( echo _initialize_gdbtypes ; grep -v '^_initialize_gdbtypes$$' ) > init.l-tmp
@echo '/* Do not modify this file. */' >>init.c-tmp
@echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
@echo '#include "defs.h"' >>init.c-tmp
@@ -2236,7 +2237,7 @@ values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
$(gdb_string_h) scm-lang.h $(doublest_h)
vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) \
- $(arch_utils_h) $(inferior_h) vax-tdep.h
+ $(arch_utils_h) $(inferior_h) $(vax_tdep_h)
x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
$(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h)
diff --git a/gdb/abug-rom.c b/gdb/abug-rom.c
index b4c44a94b54..8a9e8ff47c7 100644
--- a/gdb/abug-rom.c
+++ b/gdb/abug-rom.c
@@ -76,12 +76,22 @@ abug_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes an "A7".
*/
-static char *abug_regnames[NUM_REGS] =
+static const char *
+abug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "PC",
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "PC",
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -141,7 +151,8 @@ init_abug_cmds (void)
abug_cmds.cmd_end = NULL; /* optional command terminator */
abug_cmds.target = &abug_ops; /* target operations */
abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- abug_cmds.regnames = abug_regnames; /* registers names */
+ abug_cmds.regnames = NULL; /* registers names */
+ abug_cmds.regname = abug_regname;
abug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
};
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index d60eeb36ed7..b79a02a76ab 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -118,22 +118,6 @@ legacy_register_sim_regno (int regnum)
}
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
generic_frameless_function_invocation_not (struct frame_info *fi)
{
return 0;
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 7362f5de603..9971e5dff33 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -1144,7 +1144,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
to call this function after the PC has been adjusted. */
-struct regcache *
+static struct regcache *
generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
{
struct dummy_frame *dummyframe;
@@ -1161,6 +1161,15 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
return 0;
}
+char *
+deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
+{
+ struct regcache *regcache = generic_find_dummy_frame (pc, fp);
+ if (regcache == NULL)
+ return NULL;
+ return deprecated_grub_regcache_for_registers (regcache);
+}
+
/* Function: pc_in_call_dummy (pc, sp, fp)
Return true if the PC falls in a dummy frame created by gdb for an
@@ -1233,7 +1242,7 @@ generic_push_dummy_frame (void)
dummy_frame->sp = read_sp ();
dummy_frame->top = dummy_frame->sp;
dummy_frame->fp = fp;
- regcache_save (dummy_frame->regcache);
+ regcache_cpy (dummy_frame->regcache, current_regcache);
dummy_frame->next = dummy_frame_stack;
dummy_frame_stack = dummy_frame;
}
@@ -1281,7 +1290,7 @@ generic_pop_dummy_frame (void)
if (!dummy_frame)
error ("Can't pop dummy frame!");
dummy_frame_stack = dummy_frame->next;
- regcache_restore (dummy_frame->regcache);
+ regcache_cpy (current_regcache, dummy_frame->regcache);
flush_cached_frames ();
regcache_xfree (dummy_frame->regcache);
@@ -1366,10 +1375,11 @@ generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
#endif
gdb_assert (registers != NULL);
/* Return the actual value. */
- memcpy (bufferp,
- (deprecated_grub_regcache_for_registers (registers)
- + REGISTER_BYTE (regnum)),
- REGISTER_RAW_SIZE (regnum));
+ /* FIXME: cagney/2002-06-26: This should be via the
+ gdbarch_register_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
+ regcache_read (registers, regnum, bufferp);
}
}
@@ -1515,6 +1525,10 @@ generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
if (lval) /* found it in a CALL_DUMMY frame */
*lval = not_lval;
if (raw_buffer)
+ /* FIXME: cagney/2002-06-26: This should be via the
+ gdbarch_register_read() method so that it, on the fly,
+ constructs either a raw or pseudo register from the raw
+ register cache. */
regcache_read (generic_find_dummy_frame (frame->pc, frame->frame),
regnum, raw_buffer);
return;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 187061e45e7..ce1360d53e8 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6769,6 +6769,8 @@ delete_command (char *arg, int from_tty)
{
struct breakpoint *b, *temp;
+ dont_repeat ();
+
if (arg == 0)
{
int breaks_to_delete = 0;
diff --git a/gdb/command.h b/gdb/command.h
index 00110ce555d..9aceef6446a 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -210,6 +210,26 @@ extern void help_list (struct cmd_list_element *, char *,
extern void help_cmd_list (struct cmd_list_element *, enum command_class,
char *, int, struct ui_file *);
+extern void add_setshow_cmd (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list);
+
+extern void add_setshow_cmd_full (char *name,
+ enum command_class class,
+ var_types var_type, void *var,
+ char *set_doc, char *show_doc,
+ cmd_sfunc_ftype *set_func,
+ cmd_sfunc_ftype *show_func,
+ struct cmd_list_element **set_list,
+ struct cmd_list_element **show_list,
+ struct cmd_list_element **set_result,
+ struct cmd_list_element **show_result);
+
extern struct cmd_list_element *add_set_cmd (char *name, enum
command_class class,
var_types var_type, void *var,
diff --git a/gdb/cpu32bug-rom.c b/gdb/cpu32bug-rom.c
index 2801be9ea0f..efaf89a4b70 100644
--- a/gdb/cpu32bug-rom.c
+++ b/gdb/cpu32bug-rom.c
@@ -74,12 +74,22 @@ cpu32bug_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes an "A7".
*/
-static char *cpu32bug_regnames[NUM_REGS] =
+static const char *
+cpu32bug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC",
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC"
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -139,7 +149,8 @@ init_cpu32bug_cmds (void)
cpu32bug_cmds.cmd_end = NULL; /* optional command terminator */
cpu32bug_cmds.target = &cpu32bug_ops; /* target operations */
cpu32bug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- cpu32bug_cmds.regnames = cpu32bug_regnames; /* registers names */
+ cpu32bug_cmds.regnames = NULL; /* registers names */
+ cpu32bug_cmds.regname = cpu32bug_regname;
cpu32bug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
}; /* init_cpu32bug_cmds */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index b223f8734ee..864bac1c7dd 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1155,7 +1155,7 @@ cris_frame_init_saved_regs (struct frame_info *fi)
CORE_ADDR ip;
struct symtab_and_line sal;
int best_limit;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
/* Examine the entire prologue. */
register int frameless_p = 0;
diff --git a/gdb/dbug-rom.c b/gdb/dbug-rom.c
index f31555738eb..bd20184c006 100644
--- a/gdb/dbug-rom.c
+++ b/gdb/dbug-rom.c
@@ -76,13 +76,25 @@ dbug_supply_register (char *regname, int regnamelen, char *val, int vallen)
different names than GDB does, and don't support all the registers
either. So, typing "info reg sp" becomes an "A7". */
-static char *dbug_regnames[NUM_REGS] =
+static const char *
+dbug_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC"
- /* no float registers */
-};
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC"
+ /* no float registers */
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+
+}
+
static struct target_ops dbug_ops;
static struct monitor_ops dbug_cmds;
@@ -135,7 +147,8 @@ init_dbug_cmds (void)
dbug_cmds.cmd_end = NULL; /* optional command terminator */
dbug_cmds.target = &dbug_ops; /* target operations */
dbug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- dbug_cmds.regnames = dbug_regnames; /* registers names */
+ dbug_cmds.regnames = NULL; /* registers names */
+ dbug_cmds.regname = dbug_regname;
dbug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
} /* init_debug_ops */
diff --git a/gdb/frame.h b/gdb/frame.h
index 27bd7ff8943..d3bd2ab4d51 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -310,7 +310,13 @@ extern void generic_pop_dummy_frame (void);
extern int generic_pc_in_call_dummy (CORE_ADDR pc,
CORE_ADDR sp, CORE_ADDR fp);
-extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
+
+/* NOTE: cagney/2002-06-26: Targets should no longer use this
+ function. Instead, the contents of a dummy frames registers can be
+ obtained by applying: frame_register_unwind to the dummy frame; or
+ get_saved_register to the next outer frame. */
+
+extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
int nargs, struct value **args,
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 7450d212ec5..d1ab13fb6e1 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -42,6 +42,15 @@
#define P_FMOVM 0xf237
#define P_TRAP 0x4e40
+enum
+{
+ E_FP_REGNUM = 14, /* Contains address of executing stack frame */
+ E_SP_REGNUM = 15, /* Contains address of top of stack */
+ E_PS_REGNUM = 16, /* Contains processor status */
+ E_PC_REGNUM = 17, /* Contains program counter */
+ E_FP0_REGNUM = 18 /* Floating point register 0 */
+};
+
void m68k_frame_init_saved_regs (struct frame_info *frame_info);
static int
@@ -917,7 +926,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#if 0
tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
#endif
-
+
gdbarch = gdbarch_alloc (&info, 0);
set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
@@ -932,6 +941,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_stack_align (gdbarch, m68k_stack_align);
+
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_decr_pc_after_break (gdbarch, 2);
set_gdbarch_store_struct_return (gdbarch, m68k_store_struct_return);
@@ -940,10 +951,16 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_store_return_value (gdbarch, m68k_store_return_value);
set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
set_gdbarch_frameless_function_invocation (gdbarch,
m68k_frameless_function_invocation);
+ /* OK to default this value to 'unknown'. */
+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
+ set_gdbarch_frame_args_skip (gdbarch, 8);
+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size);
set_gdbarch_register_virtual_size (gdbarch, m68k_register_virtual_size);
@@ -956,6 +973,11 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_num_regs (gdbarch, 29);
set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
+ set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
+ set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
+ set_gdbarch_ps_regnum (gdbarch, E_PS_REGNUM);
+ set_gdbarch_fp0_regnum (gdbarch, E_FP0_REGNUM);
set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 81340d4be02..44c8e8f1e86 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -1183,7 +1183,10 @@ monitor_fetch_register (int regno)
zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
- name = current_monitor->regnames[regno];
+ if (current_monitor->regname != NULL)
+ name = current_monitor->regname (regno);
+ else
+ name = current_monitor->regnames[regno];
monitor_debug ("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)");
if (!name || (*name == '\0'))
@@ -1335,8 +1338,12 @@ monitor_store_register (int regno)
{
char *name;
ULONGEST val;
-
- name = current_monitor->regnames[regno];
+
+ if (current_monitor->regname != NULL)
+ name = current_monitor->regname (regno);
+ else
+ name = current_monitor->regnames[regno];
+
if (!name || (*name == '\0'))
{
monitor_debug ("MON Cannot store unknown register\n");
diff --git a/gdb/monitor.h b/gdb/monitor.h
index 85a44ff7e71..5d6138c4398 100644
--- a/gdb/monitor.h
+++ b/gdb/monitor.h
@@ -116,6 +116,9 @@ struct monitor_ops
struct target_ops *target; /* target operations */
int stopbits; /* number of stop bits */
char **regnames; /* array of register names in ascii */
+ /* deprecated: use regname instead */
+ const char *(*regname) (int index);
+ /* function for dynamic regname array */
int num_breakpoints; /* If set_break != NULL, number of supported
breakpoints */
int magic; /* Check value */
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index f8adb498b24..b04abc1056c 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -22,6 +22,8 @@
#if !defined (OBJFILES_H)
#define OBJFILES_H
+#include "bcache.h"
+
/* This structure maintains information on a per-objfile basis about the
"entry point" of the objfile, and the scope within which the entry point
exists. It is possible that gdb will see more than one objfile that is
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index 44d86825872..6fabab7c5b4 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -200,6 +200,8 @@ static void
ppcnbsd_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
{
+ /* Stop at main. */
+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
set_solib_svr4_fetch_link_map_offsets (gdbarch,
nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index ba6f547573f..70a75b5ed77 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1003,7 +1003,8 @@ supply_register (int regnum, char *val)
values. */
#ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
- DEPRECATED_CLEAN_UP_REGISTER_VALUE (regnum, register_buffer (regnum));
+ DEPRECATED_CLEAN_UP_REGISTER_VALUE \
+ (regnum, register_buffer (current_regcache, regnum));
#endif
}
diff --git a/gdb/remote-est.c b/gdb/remote-est.c
index e045a8951cd..0a1d7af60c2 100644
--- a/gdb/remote-est.c
+++ b/gdb/remote-est.c
@@ -76,12 +76,24 @@ est_supply_register (char *regname, int regnamelen, char *val, int vallen)
* registers either. So, typing "info reg sp" becomes a "r30".
*/
-static char *est_regnames[NUM_REGS] =
+static const char *
+est_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
- "SR", "PC",
-};
+
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
+ "SR", "PC",
+ };
+
+
+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+}
/*
* Define the monitor command strings. Since these are passed directly
@@ -143,7 +155,8 @@ init_est_cmds (void)
est_cmds.cmd_end = NULL; /* optional command terminator */
est_cmds.target = &est_ops; /* target operations */
est_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
- est_cmds.regnames = est_regnames; /* registers names */
+ est_cmds.regnames = NULL;
+ est_cmds.regname = est_regname; /*register names*/
est_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
} /* init_est_cmds */
diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c
index ec49f5d7177..cc0586f8ed5 100644
--- a/gdb/rom68k-rom.c
+++ b/gdb/rom68k-rom.c
@@ -157,11 +157,24 @@ rom68k_supply_register (char *regname, int regnamelen, char *val, int vallen)
than does GDB, and don't necessarily support all the registers
either. So, typing "info reg sp" becomes a "r30". */
-static char *rom68k_regnames[NUM_REGS] =
+static const char *
+rom68k_regname (int index)
{
- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
- "SR", "PC"};
+
+ static char *regnames[] =
+ {
+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
+ "SR", "PC"
+ };
+
+ if ((index >= (sizeof (regnames) / sizeof(regnames[0])))
+ || (index < 0) || (index >= NUM_REGS))
+ return NULL;
+ else
+ return regnames[index];
+
+}
/* Define the monitor command strings. Since these are passed directly
through to a printf style function, we may include formatting
@@ -220,7 +233,8 @@ init_rom68k_cmds (void)
rom68k_cmds.cmd_end = ".\r";
rom68k_cmds.target = &rom68k_ops;
rom68k_cmds.stopbits = SERIAL_1_STOPBITS;
- rom68k_cmds.regnames = rom68k_regnames;
+ rom68k_cmds.regnames = NULL;
+ rom68k_cmds.regname = rom68k_regname;
rom68k_cmds.magic = MONITOR_OPS_MAGIC;
} /* init_rom68k_cmds */
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 5a09361a53e..2372d25a33a 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -46,8 +46,6 @@
#include "solib-svr4.h"
#include "ppc-tdep.h"
-#include "regcache.h" /* For grub_around_regcache_for_registers. */
-
/* If the kernel has to deliver a signal, it pushes a sigcontext
structure on the stack and then calls the signal handler, passing
the address of the sigcontext in an argument register. Usually
@@ -1145,12 +1143,10 @@ ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
REGBUF, and copy that return value into VALBUF in virtual format. */
static void
-rs6000_extract_return_value (struct type *valtype, struct regcache *regs,
- char *valbuf)
+rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
int offset = 0;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- char *regbuf = deprecated_grub_regcache_for_registers (regs);
if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
{
@@ -1948,9 +1944,8 @@ rs6000_store_return_value (struct type *type, char *valbuf)
as a CORE_ADDR (or an expression that can be used as one). */
static CORE_ADDR
-rs6000_extract_struct_value_address (struct regcache *regs)
+rs6000_extract_struct_value_address (char *regbuf)
{
- /* FIXME: cagney/2002-05-11: This global variable is just a hack! */
return rs6000_struct_return_address;
}
@@ -2611,7 +2606,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
set_gdbarch_call_dummy_p (gdbarch, 1);
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
+ set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register);
set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index cb3b81de05a..b1055eddcd2 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -955,7 +955,7 @@ s390_frame_saved_pc_nofix (struct frame_info *fi)
if (fi->extra_info && fi->extra_info->saved_pc_valid)
return fi->extra_info->saved_pc;
- if (generic_find_dummy_frame (fi->pc, fi->frame))
+ if (deprecated_generic_find_dummy_frame (fi->pc, fi->frame))
return generic_read_register_dummy (fi->pc, fi->frame, S390_PC_REGNUM);
s390_frame_init_saved_regs (fi);
@@ -1009,7 +1009,7 @@ s390_frame_chain (struct frame_info *thisframe)
{
CORE_ADDR prev_fp = 0;
- if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
+ if (deprecated_generic_find_dummy_frame (thisframe->pc, thisframe->frame))
return generic_read_register_dummy (thisframe->pc, thisframe->frame,
S390_SP_REGNUM);
else
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 2ef89faadf1..d6bedd70f00 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1046,7 +1046,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
if (fi->saved_regs == NULL)
frame_saved_regs_zalloc (fi);
@@ -1385,7 +1385,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
int insn_size;
int gdb_register_number;
int register_number;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
@@ -1586,7 +1586,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
int opc;
int insn;
int r3_val = 0;
- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
if (fi->saved_regs == NULL)
@@ -1814,8 +1814,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
*lval = not_lval;
if (raw_buffer)
memcpy (raw_buffer,
- generic_find_dummy_frame (frame->pc, frame->frame) +
- REGISTER_BYTE (regnum),
+ (deprecated_generic_find_dummy_frame (frame->pc, frame->frame)
+ + REGISTER_BYTE (regnum)),
REGISTER_RAW_SIZE (regnum));
return;
}
diff --git a/gdb/symtab.h b/gdb/symtab.h
index bb22d0d4eaa..bf0fb1a4ef5 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -28,7 +28,6 @@
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free xfree
-#include "bcache.h"
/* Don't do this; it means that if some .o's are compiled with GNU C
and some are not (easy to do accidentally the way we configure
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index a723a6d0306..46dce5a6cd4 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -186,7 +186,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
/* regmask's low bit is for register 0, which is the first one
what would be pushed. */
- for (regnum = 0; regnum < AP_REGNUM; regnum++)
+ for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
{
if (regmask & (1 << regnum))
frame->saved_regs[regnum] = next_addr += 4;
@@ -199,7 +199,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
frame->saved_regs[PC_REGNUM] = frame->frame + 16;
frame->saved_regs[FP_REGNUM] = frame->frame + 12;
- frame->saved_regs[AP_REGNUM] = frame->frame + 8;
+ frame->saved_regs[VAX_AP_REGNUM] = frame->frame + 8;
frame->saved_regs[PS_REGNUM] = frame->frame + 4;
}
@@ -239,7 +239,7 @@ vax_frame_args_address (struct frame_info *frame)
if (frame->next)
return (read_memory_integer (frame->next->frame + 8, 4));
- return (read_register (AP_REGNUM));
+ return (read_register (VAX_AP_REGNUM));
}
static CORE_ADDR
@@ -276,12 +276,12 @@ vax_push_dummy_frame (void)
sp = push_word (sp, read_register (regnum));
sp = push_word (sp, read_register (PC_REGNUM));
sp = push_word (sp, read_register (FP_REGNUM));
- sp = push_word (sp, read_register (AP_REGNUM));
+ sp = push_word (sp, read_register (VAX_AP_REGNUM));
sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
sp = push_word (sp, 0);
write_register (SP_REGNUM, sp);
write_register (FP_REGNUM, sp);
- write_register (AP_REGNUM, sp + (17 * 4));
+ write_register (VAX_AP_REGNUM, sp + (17 * 4));
}
static void
@@ -296,7 +296,7 @@ vax_pop_frame (void)
| (read_register (PS_REGNUM) & 0xffff0000));
write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
+ write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
fp += 16;
for (regnum = 0; regnum < 12; regnum++)
if (regmask & (0x10000 << regnum))
@@ -353,6 +353,15 @@ vax_extract_struct_value_address (char *regbuf)
return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
}
+static const unsigned char *
+vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
+{
+ static const unsigned char vax_breakpoint[] = { 3 };
+
+ *lenptr = sizeof(vax_breakpoint);
+ return (vax_breakpoint);
+}
+
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
@@ -620,13 +629,30 @@ print_insn_arg (char *d, register char *p, CORE_ADDR addr,
static struct gdbarch *
vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
+ struct gdbarch_tdep *tdep;
struct gdbarch *gdbarch;
+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
+
+ /* Try to determine the ABI of the object we are loading. */
+
+ if (info.abfd != NULL)
+ osabi = gdbarch_lookup_osabi (info.abfd);
+
+ /* Find a candidate among extant architectures. */
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ arches != NULL;
+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
+ {
+ /* Make sure the ABI selection matches. */
+ tdep = gdbarch_tdep (arches->gdbarch);
+ if (tdep && tdep->osabi == osabi)
+ return arches->gdbarch;
+ }
- /* Right now there is only one VAX architecture variant. */
- if (arches != NULL)
- return (arches->gdbarch);
+ tdep = xmalloc (sizeof (struct gdbarch_tdep));
+ gdbarch = gdbarch_alloc (&info, tdep);
- gdbarch = gdbarch_alloc (&info, NULL);
+ tdep->osabi = osabi;
/* Register info */
set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
@@ -691,18 +717,35 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
/* Breakpoint info */
+ set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
set_gdbarch_decr_pc_after_break (gdbarch, 0);
/* Misc info */
set_gdbarch_function_start_offset (gdbarch, 2);
+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
+
+ /* Hook in ABI-specific overrides, if they have been registered. */
+ gdbarch_init_osabi (info, gdbarch, osabi);
return (gdbarch);
}
+static void
+vax_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ if (tdep == NULL)
+ return;
+
+ fprintf_unfiltered (file, "vax_dump_tdep: OS ABI = %s\n",
+ gdbarch_osabi_name (tdep->osabi));
+}
+
void
_initialize_vax_tdep (void)
{
- gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
+ gdbarch_register (bfd_arch_vax, vax_gdbarch_init, vax_dump_tdep);
tm_print_insn = vax_print_insn;
}
diff --git a/gdb/vax-tdep.h b/gdb/vax-tdep.h
index 95324bcc036..ccabdd53557 100644
--- a/gdb/vax-tdep.h
+++ b/gdb/vax-tdep.h
@@ -21,6 +21,8 @@
#ifndef VAX_TDEP_H
#define VAX_TDEP_H
+#include "osabi.h"
+
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
@@ -52,4 +54,10 @@
#define VAX_PC_REGNUM 15 /* Contains program counter */
#define VAX_PS_REGNUM 16 /* Contains processor status */
+/* Target-dependent structure in gdbarch. */
+struct gdbarch_tdep
+{
+ enum gdb_osabi osabi; /* OS/ABI of inferior. */
+};
+
#endif /* VAX_TDEP_H */
diff --git a/gdb/version.in b/gdb/version.in
index d1495fb303c..b6055426719 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-2002-06-25-cvs
+2002-06-28-cvs