• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión42a8e64187bd4a88baedc8c3e730b014a8f055ed (tree)
Tiempo2002-06-29 08:19:26
AutorAndrew Cagney <cagney@redh...>
CommiterAndrew Cagney

Log Message

merge with trunk

Cambiar Resumen

Diferencia incremental

--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -641,7 +641,7 @@ macrotab_h = macrotab.h $(obstack_h) $(bcache_h)
641641 macroscope_h = macroscope.h $(macrotab_h) $(symtab_h)
642642 memattr_h = memattr.h
643643 monitor_h = monitor.h
644-objfiles_h = objfiles.h
644+objfiles_h = objfiles.h $(bcache_h)
645645 parser_defs_h = parser-defs.h $(doublest_h)
646646 ppc_tdep_h = ppc-tdep.h osabi.h
647647 regcache_h = regcache.h
@@ -655,7 +655,7 @@ solist_h = solist.h
655655 source_h = source.h
656656 stabsread_h = stabsread.h
657657 symfile_h = symfile.h
658-symtab_h = symtab.h $(bcache_h)
658+symtab_h = symtab.h
659659 target_h = target.h $(bfd_h) $(symtab_h) $(dcache_h) $(memattr_h)
660660 terminal_h = terminal.h
661661 top_h = top.h
@@ -665,6 +665,7 @@ ui_out_h = ui-out.h
665665 valprint_h = valprint.h
666666 value_h = value.h $(symtab_h) $(gdbtypes_h) $(expression_h) $(doublest_h)
667667 varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
668+vax_tdep_h = vax-tdep.h osabi.h
668669 version_h = version.h
669670 wrapper_h = wrapper.h
670671 xcoffsolib_h = xcoffsolib.h
@@ -875,7 +876,7 @@ init.c: $(INIT_FILES)
875876 -e 's|\([^ ][^ ]*\)|$(srcdir)/\1|g' | \
876877 while read f; do grep '^_initialize_[a-z_0-9A-Z]* *(' $$f 2>/dev/null; done | \
877878 sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/\1/' | \
878- ( echo _initialize_gdbtypes ; grep -v -e '^_initialize_gdbtypes$$' ) > init.l-tmp
879+ ( echo _initialize_gdbtypes ; grep -v '^_initialize_gdbtypes$$' ) > init.l-tmp
879880 @echo '/* Do not modify this file. */' >>init.c-tmp
880881 @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
881882 @echo '#include "defs.h"' >>init.c-tmp
@@ -2236,7 +2237,7 @@ values.o: values.c $(defs_h) $(expression_h) $(frame_h) $(gdbcmd_h) \
22362237 $(gdb_string_h) scm-lang.h $(doublest_h)
22372238
22382239 vax-tdep.o: vax-tdep.c $(OP_INCLUDE)/vax.h $(defs_h) $(symtab_h) \
2239- $(arch_utils_h) $(inferior_h) vax-tdep.h
2240+ $(arch_utils_h) $(inferior_h) $(vax_tdep_h)
22402241
22412242 x86-64-linux-tdep.o : x86-64-linux-tdep.c $(defs_h) $(inferior_h) \
22422243 $(gdbcore_h) $(regcache_h) x86-64-tdep.h i386-tdep.h $(dwarf2cfi_h)
--- 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)
7676 * registers either. So, typing "info reg sp" becomes an "A7".
7777 */
7878
79-static char *abug_regnames[NUM_REGS] =
79+static const char *
80+abug_regname (int index)
8081 {
81- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
82- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
83- "PC",
84-};
82+ static char *regnames[] =
83+ {
84+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
85+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
86+ "PC",
87+ };
88+
89+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
90+ || (index < 0) || (index >= NUM_REGS))
91+ return NULL;
92+ else
93+ return regnames[index];
94+}
8595
8696 /*
8797 * Define the monitor command strings. Since these are passed directly
@@ -141,7 +151,8 @@ init_abug_cmds (void)
141151 abug_cmds.cmd_end = NULL; /* optional command terminator */
142152 abug_cmds.target = &abug_ops; /* target operations */
143153 abug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
144- abug_cmds.regnames = abug_regnames; /* registers names */
154+ abug_cmds.regnames = NULL; /* registers names */
155+ abug_cmds.regname = abug_regname;
145156 abug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
146157 };
147158
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -118,22 +118,6 @@ legacy_register_sim_regno (int regnum)
118118 }
119119
120120 int
121-legacy_register_sim_regno (int regnum)
122-{
123- /* Only makes sense to supply raw registers. */
124- gdb_assert (regnum >= 0 && regnum < NUM_REGS);
125- /* NOTE: cagney/2002-05-13: The old code did it this way and it is
126- suspected that some GDB/SIM combinations may rely on this
127- behavour. The default should be one2one_register_sim_regno
128- (below). */
129- if (REGISTER_NAME (regnum) != NULL
130- && REGISTER_NAME (regnum)[0] != '\0')
131- return regnum;
132- else
133- return LEGACY_SIM_REGNO_IGNORE;
134-}
135-
136-int
137121 generic_frameless_function_invocation_not (struct frame_info *fi)
138122 {
139123 return 0;
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -1144,7 +1144,7 @@ static struct dummy_frame *dummy_frame_stack = NULL;
11441144 adjust for DECR_PC_AFTER_BREAK. This is because it is only legal
11451145 to call this function after the PC has been adjusted. */
11461146
1147-struct regcache *
1147+static struct regcache *
11481148 generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
11491149 {
11501150 struct dummy_frame *dummyframe;
@@ -1161,6 +1161,15 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
11611161 return 0;
11621162 }
11631163
1164+char *
1165+deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
1166+{
1167+ struct regcache *regcache = generic_find_dummy_frame (pc, fp);
1168+ if (regcache == NULL)
1169+ return NULL;
1170+ return deprecated_grub_regcache_for_registers (regcache);
1171+}
1172+
11641173 /* Function: pc_in_call_dummy (pc, sp, fp)
11651174
11661175 Return true if the PC falls in a dummy frame created by gdb for an
@@ -1233,7 +1242,7 @@ generic_push_dummy_frame (void)
12331242 dummy_frame->sp = read_sp ();
12341243 dummy_frame->top = dummy_frame->sp;
12351244 dummy_frame->fp = fp;
1236- regcache_save (dummy_frame->regcache);
1245+ regcache_cpy (dummy_frame->regcache, current_regcache);
12371246 dummy_frame->next = dummy_frame_stack;
12381247 dummy_frame_stack = dummy_frame;
12391248 }
@@ -1281,7 +1290,7 @@ generic_pop_dummy_frame (void)
12811290 if (!dummy_frame)
12821291 error ("Can't pop dummy frame!");
12831292 dummy_frame_stack = dummy_frame->next;
1284- regcache_restore (dummy_frame->regcache);
1293+ regcache_cpy (current_regcache, dummy_frame->regcache);
12851294 flush_cached_frames ();
12861295
12871296 regcache_xfree (dummy_frame->regcache);
@@ -1366,10 +1375,11 @@ generic_call_dummy_register_unwind (struct frame_info *frame, void **cache,
13661375 #endif
13671376 gdb_assert (registers != NULL);
13681377 /* Return the actual value. */
1369- memcpy (bufferp,
1370- (deprecated_grub_regcache_for_registers (registers)
1371- + REGISTER_BYTE (regnum)),
1372- REGISTER_RAW_SIZE (regnum));
1378+ /* FIXME: cagney/2002-06-26: This should be via the
1379+ gdbarch_register_read() method so that it, on the fly,
1380+ constructs either a raw or pseudo register from the raw
1381+ register cache. */
1382+ regcache_read (registers, regnum, bufferp);
13731383 }
13741384 }
13751385
@@ -1515,6 +1525,10 @@ generic_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
15151525 if (lval) /* found it in a CALL_DUMMY frame */
15161526 *lval = not_lval;
15171527 if (raw_buffer)
1528+ /* FIXME: cagney/2002-06-26: This should be via the
1529+ gdbarch_register_read() method so that it, on the fly,
1530+ constructs either a raw or pseudo register from the raw
1531+ register cache. */
15181532 regcache_read (generic_find_dummy_frame (frame->pc, frame->frame),
15191533 regnum, raw_buffer);
15201534 return;
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6769,6 +6769,8 @@ delete_command (char *arg, int from_tty)
67696769 {
67706770 struct breakpoint *b, *temp;
67716771
6772+ dont_repeat ();
6773+
67726774 if (arg == 0)
67736775 {
67746776 int breaks_to_delete = 0;
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -210,6 +210,26 @@ extern void help_list (struct cmd_list_element *, char *,
210210 extern void help_cmd_list (struct cmd_list_element *, enum command_class,
211211 char *, int, struct ui_file *);
212212
213+extern void add_setshow_cmd (char *name,
214+ enum command_class class,
215+ var_types var_type, void *var,
216+ char *set_doc, char *show_doc,
217+ cmd_sfunc_ftype *set_func,
218+ cmd_sfunc_ftype *show_func,
219+ struct cmd_list_element **set_list,
220+ struct cmd_list_element **show_list);
221+
222+extern void add_setshow_cmd_full (char *name,
223+ enum command_class class,
224+ var_types var_type, void *var,
225+ char *set_doc, char *show_doc,
226+ cmd_sfunc_ftype *set_func,
227+ cmd_sfunc_ftype *show_func,
228+ struct cmd_list_element **set_list,
229+ struct cmd_list_element **show_list,
230+ struct cmd_list_element **set_result,
231+ struct cmd_list_element **show_result);
232+
213233 extern struct cmd_list_element *add_set_cmd (char *name, enum
214234 command_class class,
215235 var_types var_type, void *var,
--- 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)
7474 * registers either. So, typing "info reg sp" becomes an "A7".
7575 */
7676
77-static char *cpu32bug_regnames[NUM_REGS] =
77+static const char *
78+cpu32bug_regname (int index)
7879 {
79- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
80- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
81- "SR", "PC",
82-};
80+ static char *regnames[] =
81+ {
82+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
83+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
84+ "SR", "PC"
85+ };
86+
87+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
88+ || (index < 0) || (index >= NUM_REGS))
89+ return NULL;
90+ else
91+ return regnames[index];
92+}
8393
8494 /*
8595 * Define the monitor command strings. Since these are passed directly
@@ -139,7 +149,8 @@ init_cpu32bug_cmds (void)
139149 cpu32bug_cmds.cmd_end = NULL; /* optional command terminator */
140150 cpu32bug_cmds.target = &cpu32bug_ops; /* target operations */
141151 cpu32bug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
142- cpu32bug_cmds.regnames = cpu32bug_regnames; /* registers names */
152+ cpu32bug_cmds.regnames = NULL; /* registers names */
153+ cpu32bug_cmds.regname = cpu32bug_regname;
143154 cpu32bug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
144155 }; /* init_cpu32bug_cmds */
145156
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -1155,7 +1155,7 @@ cris_frame_init_saved_regs (struct frame_info *fi)
11551155 CORE_ADDR ip;
11561156 struct symtab_and_line sal;
11571157 int best_limit;
1158- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
1158+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
11591159
11601160 /* Examine the entire prologue. */
11611161 register int frameless_p = 0;
--- 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)
7676 different names than GDB does, and don't support all the registers
7777 either. So, typing "info reg sp" becomes an "A7". */
7878
79-static char *dbug_regnames[NUM_REGS] =
79+static const char *
80+dbug_regname (int index)
8081 {
81- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
82- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
83- "SR", "PC"
84- /* no float registers */
85-};
82+ static char *regnames[] =
83+ {
84+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
85+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
86+ "SR", "PC"
87+ /* no float registers */
88+ };
89+
90+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
91+ || (index < 0) || (index >= NUM_REGS))
92+ return NULL;
93+ else
94+ return regnames[index];
95+
96+}
97+
8698 static struct target_ops dbug_ops;
8799 static struct monitor_ops dbug_cmds;
88100
@@ -135,7 +147,8 @@ init_dbug_cmds (void)
135147 dbug_cmds.cmd_end = NULL; /* optional command terminator */
136148 dbug_cmds.target = &dbug_ops; /* target operations */
137149 dbug_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
138- dbug_cmds.regnames = dbug_regnames; /* registers names */
150+ dbug_cmds.regnames = NULL; /* registers names */
151+ dbug_cmds.regname = dbug_regname;
139152 dbug_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
140153 } /* init_debug_ops */
141154
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -310,7 +310,13 @@ extern void generic_pop_dummy_frame (void);
310310
311311 extern int generic_pc_in_call_dummy (CORE_ADDR pc,
312312 CORE_ADDR sp, CORE_ADDR fp);
313-extern struct regcache *generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
313+
314+/* NOTE: cagney/2002-06-26: Targets should no longer use this
315+ function. Instead, the contents of a dummy frames registers can be
316+ obtained by applying: frame_register_unwind to the dummy frame; or
317+ get_saved_register to the next outer frame. */
318+
319+extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
314320
315321 extern void generic_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
316322 int nargs, struct value **args,
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -42,6 +42,15 @@
4242 #define P_FMOVM 0xf237
4343 #define P_TRAP 0x4e40
4444
45+enum
46+{
47+ E_FP_REGNUM = 14, /* Contains address of executing stack frame */
48+ E_SP_REGNUM = 15, /* Contains address of top of stack */
49+ E_PS_REGNUM = 16, /* Contains processor status */
50+ E_PC_REGNUM = 17, /* Contains program counter */
51+ E_FP0_REGNUM = 18 /* Floating point register 0 */
52+};
53+
4554 void m68k_frame_init_saved_regs (struct frame_info *frame_info);
4655
4756 static int
@@ -917,7 +926,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
917926 #if 0
918927 tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep));
919928 #endif
920-
929+
921930 gdbarch = gdbarch_alloc (&info, 0);
922931
923932 set_gdbarch_long_double_format (gdbarch, &floatformat_m68881_ext);
@@ -932,6 +941,8 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
932941 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
933942 set_gdbarch_stack_align (gdbarch, m68k_stack_align);
934943
944+
945+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
935946 set_gdbarch_decr_pc_after_break (gdbarch, 2);
936947
937948 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)
940951 set_gdbarch_store_return_value (gdbarch, m68k_store_return_value);
941952
942953 set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
954+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
943955 set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
944956 set_gdbarch_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
945957 set_gdbarch_frameless_function_invocation (gdbarch,
946958 m68k_frameless_function_invocation);
959+ /* OK to default this value to 'unknown'. */
960+ set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
961+ set_gdbarch_frame_args_skip (gdbarch, 8);
962+ set_gdbarch_frame_args_address (gdbarch, default_frame_address);
963+ set_gdbarch_frame_locals_address (gdbarch, default_frame_address);
947964
948965 set_gdbarch_register_raw_size (gdbarch, m68k_register_raw_size);
949966 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)
956973 set_gdbarch_num_regs (gdbarch, 29);
957974 set_gdbarch_register_bytes_ok (gdbarch, m68k_register_bytes_ok);
958975 set_gdbarch_register_bytes (gdbarch, (16 * 4 + 8 + 8 * 12 + 3 * 4));
976+ set_gdbarch_sp_regnum (gdbarch, E_SP_REGNUM);
977+ set_gdbarch_fp_regnum (gdbarch, E_FP_REGNUM);
978+ set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
979+ set_gdbarch_ps_regnum (gdbarch, E_PS_REGNUM);
980+ set_gdbarch_fp0_regnum (gdbarch, E_FP0_REGNUM);
959981
960982 set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
961983 set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -1183,7 +1183,10 @@ monitor_fetch_register (int regno)
11831183 zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
11841184 memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
11851185
1186- name = current_monitor->regnames[regno];
1186+ if (current_monitor->regname != NULL)
1187+ name = current_monitor->regname (regno);
1188+ else
1189+ name = current_monitor->regnames[regno];
11871190 monitor_debug ("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)");
11881191
11891192 if (!name || (*name == '\0'))
@@ -1335,8 +1338,12 @@ monitor_store_register (int regno)
13351338 {
13361339 char *name;
13371340 ULONGEST val;
1338-
1339- name = current_monitor->regnames[regno];
1341+
1342+ if (current_monitor->regname != NULL)
1343+ name = current_monitor->regname (regno);
1344+ else
1345+ name = current_monitor->regnames[regno];
1346+
13401347 if (!name || (*name == '\0'))
13411348 {
13421349 monitor_debug ("MON Cannot store unknown register\n");
--- a/gdb/monitor.h
+++ b/gdb/monitor.h
@@ -116,6 +116,9 @@ struct monitor_ops
116116 struct target_ops *target; /* target operations */
117117 int stopbits; /* number of stop bits */
118118 char **regnames; /* array of register names in ascii */
119+ /* deprecated: use regname instead */
120+ const char *(*regname) (int index);
121+ /* function for dynamic regname array */
119122 int num_breakpoints; /* If set_break != NULL, number of supported
120123 breakpoints */
121124 int magic; /* Check value */
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -22,6 +22,8 @@
2222 #if !defined (OBJFILES_H)
2323 #define OBJFILES_H
2424
25+#include "bcache.h"
26+
2527 /* This structure maintains information on a per-objfile basis about the
2628 "entry point" of the objfile, and the scope within which the entry point
2729 exists. It is possible that gdb will see more than one objfile that is
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -200,6 +200,8 @@ static void
200200 ppcnbsd_init_abi (struct gdbarch_info info,
201201 struct gdbarch *gdbarch)
202202 {
203+ /* Stop at main. */
204+ set_gdbarch_frame_chain_valid (gdbarch, generic_func_frame_chain_valid);
203205
204206 set_solib_svr4_fetch_link_map_offsets (gdbarch,
205207 nbsd_ilp32_solib_svr4_fetch_link_map_offsets);
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1003,7 +1003,8 @@ supply_register (int regnum, char *val)
10031003 values. */
10041004
10051005 #ifdef DEPRECATED_CLEAN_UP_REGISTER_VALUE
1006- DEPRECATED_CLEAN_UP_REGISTER_VALUE (regnum, register_buffer (regnum));
1006+ DEPRECATED_CLEAN_UP_REGISTER_VALUE \
1007+ (regnum, register_buffer (current_regcache, regnum));
10071008 #endif
10081009 }
10091010
--- 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)
7676 * registers either. So, typing "info reg sp" becomes a "r30".
7777 */
7878
79-static char *est_regnames[NUM_REGS] =
79+static const char *
80+est_regname (int index)
8081 {
81- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
82- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
83- "SR", "PC",
84-};
82+
83+ static char *regnames[] =
84+ {
85+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
86+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7",
87+ "SR", "PC",
88+ };
89+
90+
91+ if ((index >= (sizeof (regnames) / sizeof (regnames[0])))
92+ || (index < 0) || (index >= NUM_REGS))
93+ return NULL;
94+ else
95+ return regnames[index];
96+}
8597
8698 /*
8799 * Define the monitor command strings. Since these are passed directly
@@ -143,7 +155,8 @@ init_est_cmds (void)
143155 est_cmds.cmd_end = NULL; /* optional command terminator */
144156 est_cmds.target = &est_ops; /* target operations */
145157 est_cmds.stopbits = SERIAL_1_STOPBITS; /* number of stop bits */
146- est_cmds.regnames = est_regnames; /* registers names */
158+ est_cmds.regnames = NULL;
159+ est_cmds.regname = est_regname; /*register names*/
147160 est_cmds.magic = MONITOR_OPS_MAGIC; /* magic */
148161 } /* init_est_cmds */
149162
--- 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)
157157 than does GDB, and don't necessarily support all the registers
158158 either. So, typing "info reg sp" becomes a "r30". */
159159
160-static char *rom68k_regnames[NUM_REGS] =
160+static const char *
161+rom68k_regname (int index)
161162 {
162- "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
163- "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
164- "SR", "PC"};
163+
164+ static char *regnames[] =
165+ {
166+ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
167+ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "ISP",
168+ "SR", "PC"
169+ };
170+
171+ if ((index >= (sizeof (regnames) / sizeof(regnames[0])))
172+ || (index < 0) || (index >= NUM_REGS))
173+ return NULL;
174+ else
175+ return regnames[index];
176+
177+}
165178
166179 /* Define the monitor command strings. Since these are passed directly
167180 through to a printf style function, we may include formatting
@@ -220,7 +233,8 @@ init_rom68k_cmds (void)
220233 rom68k_cmds.cmd_end = ".\r";
221234 rom68k_cmds.target = &rom68k_ops;
222235 rom68k_cmds.stopbits = SERIAL_1_STOPBITS;
223- rom68k_cmds.regnames = rom68k_regnames;
236+ rom68k_cmds.regnames = NULL;
237+ rom68k_cmds.regname = rom68k_regname;
224238 rom68k_cmds.magic = MONITOR_OPS_MAGIC;
225239 } /* init_rom68k_cmds */
226240
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -46,8 +46,6 @@
4646 #include "solib-svr4.h"
4747 #include "ppc-tdep.h"
4848
49-#include "regcache.h" /* For grub_around_regcache_for_registers. */
50-
5149 /* If the kernel has to deliver a signal, it pushes a sigcontext
5250 structure on the stack and then calls the signal handler, passing
5351 the address of the sigcontext in an argument register. Usually
@@ -1145,12 +1143,10 @@ ppc_push_return_address (CORE_ADDR pc, CORE_ADDR sp)
11451143 REGBUF, and copy that return value into VALBUF in virtual format. */
11461144
11471145 static void
1148-rs6000_extract_return_value (struct type *valtype, struct regcache *regs,
1149- char *valbuf)
1146+rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
11501147 {
11511148 int offset = 0;
11521149 struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
1153- char *regbuf = deprecated_grub_regcache_for_registers (regs);
11541150
11551151 if (TYPE_CODE (valtype) == TYPE_CODE_FLT)
11561152 {
@@ -1948,9 +1944,8 @@ rs6000_store_return_value (struct type *type, char *valbuf)
19481944 as a CORE_ADDR (or an expression that can be used as one). */
19491945
19501946 static CORE_ADDR
1951-rs6000_extract_struct_value_address (struct regcache *regs)
1947+rs6000_extract_struct_value_address (char *regbuf)
19521948 {
1953- /* FIXME: cagney/2002-05-11: This global variable is just a hack! */
19541949 return rs6000_struct_return_address;
19551950 }
19561951
@@ -2611,7 +2606,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
26112606 set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
26122607 set_gdbarch_call_dummy_p (gdbarch, 1);
26132608 set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
2614- set_gdbarch_get_saved_register (gdbarch, generic_get_saved_register);
2609+ set_gdbarch_get_saved_register (gdbarch, generic_unwind_get_saved_register);
26152610 set_gdbarch_fix_call_dummy (gdbarch, rs6000_fix_call_dummy);
26162611 set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
26172612 set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -955,7 +955,7 @@ s390_frame_saved_pc_nofix (struct frame_info *fi)
955955 if (fi->extra_info && fi->extra_info->saved_pc_valid)
956956 return fi->extra_info->saved_pc;
957957
958- if (generic_find_dummy_frame (fi->pc, fi->frame))
958+ if (deprecated_generic_find_dummy_frame (fi->pc, fi->frame))
959959 return generic_read_register_dummy (fi->pc, fi->frame, S390_PC_REGNUM);
960960
961961 s390_frame_init_saved_regs (fi);
@@ -1009,7 +1009,7 @@ s390_frame_chain (struct frame_info *thisframe)
10091009 {
10101010 CORE_ADDR prev_fp = 0;
10111011
1012- if (generic_find_dummy_frame (thisframe->pc, thisframe->frame))
1012+ if (deprecated_generic_find_dummy_frame (thisframe->pc, thisframe->frame))
10131013 return generic_read_register_dummy (thisframe->pc, thisframe->frame,
10141014 S390_SP_REGNUM);
10151015 else
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1046,7 +1046,7 @@ sh_nofp_frame_init_saved_regs (struct frame_info *fi)
10461046 int opc;
10471047 int insn;
10481048 int r3_val = 0;
1049- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
1049+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
10501050
10511051 if (fi->saved_regs == NULL)
10521052 frame_saved_regs_zalloc (fi);
@@ -1385,7 +1385,7 @@ sh64_nofp_frame_init_saved_regs (struct frame_info *fi)
13851385 int insn_size;
13861386 int gdb_register_number;
13871387 int register_number;
1388- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
1388+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
13891389 struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
13901390
13911391 if (fi->saved_regs == NULL)
@@ -1586,7 +1586,7 @@ sh_fp_frame_init_saved_regs (struct frame_info *fi)
15861586 int opc;
15871587 int insn;
15881588 int r3_val = 0;
1589- char *dummy_regs = generic_find_dummy_frame (fi->pc, fi->frame);
1589+ char *dummy_regs = deprecated_generic_find_dummy_frame (fi->pc, fi->frame);
15901590 struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
15911591
15921592 if (fi->saved_regs == NULL)
@@ -1814,8 +1814,8 @@ sh64_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
18141814 *lval = not_lval;
18151815 if (raw_buffer)
18161816 memcpy (raw_buffer,
1817- generic_find_dummy_frame (frame->pc, frame->frame) +
1818- REGISTER_BYTE (regnum),
1817+ (deprecated_generic_find_dummy_frame (frame->pc, frame->frame)
1818+ + REGISTER_BYTE (regnum)),
18191819 REGISTER_RAW_SIZE (regnum));
18201820 return;
18211821 }
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -28,7 +28,6 @@
2828 #include "obstack.h"
2929 #define obstack_chunk_alloc xmalloc
3030 #define obstack_chunk_free xfree
31-#include "bcache.h"
3231
3332 /* Don't do this; it means that if some .o's are compiled with GNU C
3433 and some are not (easy to do accidentally the way we configure
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -186,7 +186,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
186186
187187 /* regmask's low bit is for register 0, which is the first one
188188 what would be pushed. */
189- for (regnum = 0; regnum < AP_REGNUM; regnum++)
189+ for (regnum = 0; regnum < VAX_AP_REGNUM; regnum++)
190190 {
191191 if (regmask & (1 << regnum))
192192 frame->saved_regs[regnum] = next_addr += 4;
@@ -199,7 +199,7 @@ vax_frame_init_saved_regs (struct frame_info *frame)
199199
200200 frame->saved_regs[PC_REGNUM] = frame->frame + 16;
201201 frame->saved_regs[FP_REGNUM] = frame->frame + 12;
202- frame->saved_regs[AP_REGNUM] = frame->frame + 8;
202+ frame->saved_regs[VAX_AP_REGNUM] = frame->frame + 8;
203203 frame->saved_regs[PS_REGNUM] = frame->frame + 4;
204204 }
205205
@@ -239,7 +239,7 @@ vax_frame_args_address (struct frame_info *frame)
239239 if (frame->next)
240240 return (read_memory_integer (frame->next->frame + 8, 4));
241241
242- return (read_register (AP_REGNUM));
242+ return (read_register (VAX_AP_REGNUM));
243243 }
244244
245245 static CORE_ADDR
@@ -276,12 +276,12 @@ vax_push_dummy_frame (void)
276276 sp = push_word (sp, read_register (regnum));
277277 sp = push_word (sp, read_register (PC_REGNUM));
278278 sp = push_word (sp, read_register (FP_REGNUM));
279- sp = push_word (sp, read_register (AP_REGNUM));
279+ sp = push_word (sp, read_register (VAX_AP_REGNUM));
280280 sp = push_word (sp, (read_register (PS_REGNUM) & 0xffef) + 0x2fff0000);
281281 sp = push_word (sp, 0);
282282 write_register (SP_REGNUM, sp);
283283 write_register (FP_REGNUM, sp);
284- write_register (AP_REGNUM, sp + (17 * 4));
284+ write_register (VAX_AP_REGNUM, sp + (17 * 4));
285285 }
286286
287287 static void
@@ -296,7 +296,7 @@ vax_pop_frame (void)
296296 | (read_register (PS_REGNUM) & 0xffff0000));
297297 write_register (PC_REGNUM, read_memory_integer (fp + 16, 4));
298298 write_register (FP_REGNUM, read_memory_integer (fp + 12, 4));
299- write_register (AP_REGNUM, read_memory_integer (fp + 8, 4));
299+ write_register (VAX_AP_REGNUM, read_memory_integer (fp + 8, 4));
300300 fp += 16;
301301 for (regnum = 0; regnum < 12; regnum++)
302302 if (regmask & (0x10000 << regnum))
@@ -353,6 +353,15 @@ vax_extract_struct_value_address (char *regbuf)
353353 return (extract_address (regbuf + REGISTER_BYTE (0), REGISTER_RAW_SIZE (0)));
354354 }
355355
356+static const unsigned char *
357+vax_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
358+{
359+ static const unsigned char vax_breakpoint[] = { 3 };
360+
361+ *lenptr = sizeof(vax_breakpoint);
362+ return (vax_breakpoint);
363+}
364+
356365 /* Advance PC across any function entry prologue instructions
357366 to reach some "real" code. */
358367
@@ -620,13 +629,30 @@ print_insn_arg (char *d, register char *p, CORE_ADDR addr,
620629 static struct gdbarch *
621630 vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
622631 {
632+ struct gdbarch_tdep *tdep;
623633 struct gdbarch *gdbarch;
634+ enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
635+
636+ /* Try to determine the ABI of the object we are loading. */
637+
638+ if (info.abfd != NULL)
639+ osabi = gdbarch_lookup_osabi (info.abfd);
640+
641+ /* Find a candidate among extant architectures. */
642+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
643+ arches != NULL;
644+ arches = gdbarch_list_lookup_by_info (arches->next, &info))
645+ {
646+ /* Make sure the ABI selection matches. */
647+ tdep = gdbarch_tdep (arches->gdbarch);
648+ if (tdep && tdep->osabi == osabi)
649+ return arches->gdbarch;
650+ }
624651
625- /* Right now there is only one VAX architecture variant. */
626- if (arches != NULL)
627- return (arches->gdbarch);
652+ tdep = xmalloc (sizeof (struct gdbarch_tdep));
653+ gdbarch = gdbarch_alloc (&info, tdep);
628654
629- gdbarch = gdbarch_alloc (&info, NULL);
655+ tdep->osabi = osabi;
630656
631657 /* Register info */
632658 set_gdbarch_num_regs (gdbarch, VAX_NUM_REGS);
@@ -691,18 +717,35 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
691717 set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
692718
693719 /* Breakpoint info */
720+ set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
694721 set_gdbarch_decr_pc_after_break (gdbarch, 0);
695722
696723 /* Misc info */
697724 set_gdbarch_function_start_offset (gdbarch, 2);
725+ set_gdbarch_believe_pcc_promotion (gdbarch, 1);
726+
727+ /* Hook in ABI-specific overrides, if they have been registered. */
728+ gdbarch_init_osabi (info, gdbarch, osabi);
698729
699730 return (gdbarch);
700731 }
701732
733+static void
734+vax_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
735+{
736+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
737+
738+ if (tdep == NULL)
739+ return;
740+
741+ fprintf_unfiltered (file, "vax_dump_tdep: OS ABI = %s\n",
742+ gdbarch_osabi_name (tdep->osabi));
743+}
744+
702745 void
703746 _initialize_vax_tdep (void)
704747 {
705- gdbarch_register (bfd_arch_vax, vax_gdbarch_init, NULL);
748+ gdbarch_register (bfd_arch_vax, vax_gdbarch_init, vax_dump_tdep);
706749
707750 tm_print_insn = vax_print_insn;
708751 }
--- a/gdb/vax-tdep.h
+++ b/gdb/vax-tdep.h
@@ -21,6 +21,8 @@
2121 #ifndef VAX_TDEP_H
2222 #define VAX_TDEP_H
2323
24+#include "osabi.h"
25+
2426 /* Say how long (ordinary) registers are. This is a piece of bogosity
2527 used in push_word and a few other places; REGISTER_RAW_SIZE is the
2628 real way to know how big a register is. */
@@ -52,4 +54,10 @@
5254 #define VAX_PC_REGNUM 15 /* Contains program counter */
5355 #define VAX_PS_REGNUM 16 /* Contains processor status */
5456
57+/* Target-dependent structure in gdbarch. */
58+struct gdbarch_tdep
59+{
60+ enum gdb_osabi osabi; /* OS/ABI of inferior. */
61+};
62+
5563 #endif /* VAX_TDEP_H */
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
1-2002-06-25-cvs
1+2002-06-28-cvs