aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-12-06 19:26:06 +0000
committerAndrew Cagney <cagney@redhat.com>2002-12-06 19:26:06 +0000
commit2ca6c561875beb2a062b218f81ebf30e2dd7ec9c (patch)
treea385f9ec1b8ccdb0cd0c7422b6da2f30a4daafde
parentde46ecd713c0b4dbf5ef7a26b293aa6b11cf3635 (diff)
downloadgdb-2ca6c561875beb2a062b218f81ebf30e2dd7ec9c.zip
gdb-2ca6c561875beb2a062b218f81ebf30e2dd7ec9c.tar.gz
gdb-2ca6c561875beb2a062b218f81ebf30e2dd7ec9c.tar.bz2
2002-12-06 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename INIT_FRAME_PC_FIRST. Change to a function with predicate. Do not provide a default value. * gdbarch.h, gdbarch.c: Regenerate. * frame.c (get_prev_frame): Update. Check DEPRECATED_INIT_FRAME_PC_FIRST_P. * s390-tdep.c (s390_gdbarch_init): Update. * mips-tdep.c (mips_gdbarch_init): Update. * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update. * alpha-tdep.c (alpha_gdbarch_init): Update.
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/alpha-tdep.c3
-rw-r--r--gdb/config/rs6000/tm-rs6000.h2
-rw-r--r--gdb/config/sparc/tm-sparc.h2
-rw-r--r--gdb/frame.c8
-rw-r--r--gdb/gdbarch.c65
-rw-r--r--gdb/gdbarch.h38
-rwxr-xr-xgdb/gdbarch.sh2
-rw-r--r--gdb/mips-tdep.c4
-rw-r--r--gdb/s390-tdep.c2
10 files changed, 95 insertions, 45 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cf2237c..efd95fa 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,17 @@
+2002-12-06 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbarch.sh (DEPRECATED_INIT_FRAME_PC_FIRST): Rename
+ INIT_FRAME_PC_FIRST. Change to a function with predicate. Do not
+ provide a default value.
+ * gdbarch.h, gdbarch.c: Regenerate.
+ * frame.c (get_prev_frame): Update. Check
+ DEPRECATED_INIT_FRAME_PC_FIRST_P.
+ * s390-tdep.c (s390_gdbarch_init): Update.
+ * mips-tdep.c (mips_gdbarch_init): Update.
+ * config/sparc/tm-sparc.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
+ * config/rs6000/tm-rs6000.h (DEPRECATED_INIT_FRAME_PC_FIRST): Update.
+ * alpha-tdep.c (alpha_gdbarch_init): Update.
+
2002-12-06 Elena Zannoni <ezannoni@redhat.com>
* ia64-linux-nat.c: Include gdb_string.h.
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 1f38f68..6d998c4 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -73,7 +73,6 @@ static gdbarch_push_arguments_ftype alpha_push_arguments;
static gdbarch_push_dummy_frame_ftype alpha_push_dummy_frame;
static gdbarch_pop_frame_ftype alpha_pop_frame;
static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
-static gdbarch_init_frame_pc_first_ftype alpha_init_frame_pc_first;
static gdbarch_init_extra_frame_info_ftype alpha_init_extra_frame_info;
static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
@@ -1896,7 +1895,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_push_dummy_frame (gdbarch, alpha_push_dummy_frame);
set_gdbarch_fix_call_dummy (gdbarch, alpha_fix_call_dummy);
set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
- set_gdbarch_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
+ set_gdbarch_deprecated_init_frame_pc_first (gdbarch, alpha_init_frame_pc_first);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index 478e9bd..30f8486 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -78,7 +78,7 @@ extern void aix_process_linenos (void);
/* Define other aspects of the stack frame. */
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) \
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \
prev->pc = (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ());
#define INIT_FRAME_PC(fromleaf, prev) /* nothing */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 7cced22..ce94d94 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -520,7 +520,7 @@ extern void sparc_print_extra_frame_info (struct frame_info *);
/* INIT_EXTRA_FRAME_INFO needs the PC to detect flat frames. */
#define INIT_FRAME_PC(FROMLEAF, PREV) /* nothing */
-#define INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
+#define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
(PREV)->pc = ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \
(PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ());
diff --git a/gdb/frame.c b/gdb/frame.c
index b4e2cfd..4e31c93 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -986,8 +986,9 @@ get_prev_frame (struct frame_info *next_frame)
to require INIT_EXTRA_FRAME_INFO before they can do
INIT_FRAME_PC. Phoo.
- We shouldn't need INIT_FRAME_PC_FIRST to add more complication to
- an already overcomplicated part of GDB. gnu@cygnus.com, 15Sep92.
+ We shouldn't need DEPRECATED_INIT_FRAME_PC_FIRST to add more
+ complication to an already overcomplicated part of GDB.
+ gnu@cygnus.com, 15Sep92.
Assuming that some machines need INIT_FRAME_PC after
INIT_EXTRA_FRAME_INFO, one possible scheme:
@@ -1040,7 +1041,8 @@ get_prev_frame (struct frame_info *next_frame)
FRAME_SAVED_PC() is being superseed by frame_pc_unwind() and that
function does have somewhere to cache that PC value. */
- INIT_FRAME_PC_FIRST (fromleaf, prev);
+ if (DEPRECATED_INIT_FRAME_PC_FIRST_P ())
+ DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev);
if (INIT_EXTRA_FRAME_INFO_P ())
INIT_EXTRA_FRAME_INFO (fromleaf, prev);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 922ba57..ef56820 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -195,7 +195,7 @@ struct gdbarch
int call_dummy_stack_adjust_p;
int call_dummy_stack_adjust;
gdbarch_fix_call_dummy_ftype *fix_call_dummy;
- gdbarch_init_frame_pc_first_ftype *init_frame_pc_first;
+ gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first;
gdbarch_init_frame_pc_ftype *init_frame_pc;
int believe_pcc_promotion;
int believe_pcc_promotion_type;
@@ -533,7 +533,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->call_dummy_words = legacy_call_dummy_words;
current_gdbarch->sizeof_call_dummy_words = legacy_sizeof_call_dummy_words;
current_gdbarch->call_dummy_stack_adjust_p = -1;
- current_gdbarch->init_frame_pc_first = init_frame_pc_noop;
current_gdbarch->init_frame_pc = init_frame_pc_default;
current_gdbarch->coerce_float_to_double = default_coerce_float_to_double;
current_gdbarch->register_convertible = generic_register_convertible_not;
@@ -712,7 +711,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
&& (gdbarch->fix_call_dummy == 0))
fprintf_unfiltered (log, "\n\tfix_call_dummy");
- /* Skip verify of init_frame_pc_first, invalid_p == 0 */
+ /* Skip verify of deprecated_init_frame_pc_first, has predicate */
/* Skip verify of init_frame_pc, invalid_p == 0 */
/* Skip verify of coerce_float_to_double, invalid_p == 0 */
/* Skip verify of get_saved_register, has predicate */
@@ -1193,6 +1192,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->deprecated_extract_struct_value_address
/*DEPRECATED_EXTRACT_STRUCT_VALUE_ADDRESS ()*/);
#endif
+#ifdef DEPRECATED_INIT_FRAME_PC_FIRST_P
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_INIT_FRAME_PC_FIRST_P()",
+ XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST_P ()));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST_P() = %d\n",
+ DEPRECATED_INIT_FRAME_PC_FIRST_P ());
+#endif
+#ifdef DEPRECATED_INIT_FRAME_PC_FIRST
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev)",
+ XSTRING (DEPRECATED_INIT_FRAME_PC_FIRST (fromleaf, prev)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_INIT_FRAME_PC_FIRST = 0x%08lx\n",
+ (long) current_gdbarch->deprecated_init_frame_pc_first
+ /*DEPRECATED_INIT_FRAME_PC_FIRST ()*/);
+#endif
#ifdef DEPRECATED_PC_IN_CALL_DUMMY_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1572,20 +1594,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->init_frame_pc
/*INIT_FRAME_PC ()*/);
#endif
-#ifdef INIT_FRAME_PC_FIRST
-#if GDB_MULTI_ARCH
- /* Macro might contain `[{}]' when not multi-arch */
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "INIT_FRAME_PC_FIRST(fromleaf, prev)",
- XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
-#endif
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
- (long) current_gdbarch->init_frame_pc_first
- /*INIT_FRAME_PC_FIRST ()*/);
-#endif
#ifdef INNER_THAN
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -3776,23 +3784,30 @@ set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch,
gdbarch->fix_call_dummy = fix_call_dummy;
}
+int
+gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ return gdbarch->deprecated_init_frame_pc_first != 0;
+}
+
void
-gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
+gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev)
{
gdb_assert (gdbarch != NULL);
- if (gdbarch->init_frame_pc_first == 0)
+ if (gdbarch->deprecated_init_frame_pc_first == 0)
internal_error (__FILE__, __LINE__,
- "gdbarch: gdbarch_init_frame_pc_first invalid");
+ "gdbarch: gdbarch_deprecated_init_frame_pc_first invalid");
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_init_frame_pc_first called\n");
- gdbarch->init_frame_pc_first (fromleaf, prev);
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_init_frame_pc_first called\n");
+ gdbarch->deprecated_init_frame_pc_first (fromleaf, prev);
}
void
-set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch,
- gdbarch_init_frame_pc_first_ftype init_frame_pc_first)
+set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch,
+ gdbarch_deprecated_init_frame_pc_first_ftype deprecated_init_frame_pc_first)
{
- gdbarch->init_frame_pc_first = init_frame_pc_first;
+ gdbarch->deprecated_init_frame_pc_first = deprecated_init_frame_pc_first;
}
void
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index f472e57..c72897d 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -1178,20 +1178,40 @@ extern void set_gdbarch_fix_call_dummy (struct gdbarch *gdbarch, gdbarch_fix_cal
#endif
#endif
+#if defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+/* Legacy for systems yet to multi-arch DEPRECATED_INIT_FRAME_PC_FIRST */
+#if !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (1)
+#endif
+#endif
+
+/* Default predicate for non- multi-arch targets. */
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (0)
+#endif
+
+extern int gdbarch_deprecated_init_frame_pc_first_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
+#endif
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST_P)
+#define DEPRECATED_INIT_FRAME_PC_FIRST_P() (gdbarch_deprecated_init_frame_pc_first_p (current_gdbarch))
+#endif
+
/* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (INIT_FRAME_PC_FIRST)
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) (init_frame_pc_noop (fromleaf, prev))
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (internal_error (__FILE__, __LINE__, "DEPRECATED_INIT_FRAME_PC_FIRST"), 0)
#endif
-typedef void (gdbarch_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
-extern void gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
-extern void set_gdbarch_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_init_frame_pc_first_ftype *init_frame_pc_first);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (INIT_FRAME_PC_FIRST)
-#error "Non multi-arch definition of INIT_FRAME_PC_FIRST"
+typedef void (gdbarch_deprecated_init_frame_pc_first_ftype) (int fromleaf, struct frame_info *prev);
+extern void gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, int fromleaf, struct frame_info *prev);
+extern void set_gdbarch_deprecated_init_frame_pc_first (struct gdbarch *gdbarch, gdbarch_deprecated_init_frame_pc_first_ftype *deprecated_init_frame_pc_first);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#error "Non multi-arch definition of DEPRECATED_INIT_FRAME_PC_FIRST"
#endif
#if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (INIT_FRAME_PC_FIRST)
-#define INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_init_frame_pc_first (current_gdbarch, fromleaf, prev))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_INIT_FRAME_PC_FIRST)
+#define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) (gdbarch_deprecated_init_frame_pc_first (current_gdbarch, fromleaf, prev))
#endif
#endif
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index f197211..db07119 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -513,7 +513,7 @@ v:2:SIZEOF_CALL_DUMMY_WORDS:int:sizeof_call_dummy_words::::0:legacy_sizeof_call_
v:1:CALL_DUMMY_STACK_ADJUST_P:int:call_dummy_stack_adjust_p::::0:-1:::0x%08lx
v:2:CALL_DUMMY_STACK_ADJUST:int:call_dummy_stack_adjust::::0:::gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0:0x%08lx::CALL_DUMMY_STACK_ADJUST_P
f:2:FIX_CALL_DUMMY:void:fix_call_dummy:char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p:dummy, pc, fun, nargs, args, type, gcc_p:::0
-f:2:INIT_FRAME_PC_FIRST:void:init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_noop::0
+F::DEPRECATED_INIT_FRAME_PC_FIRST:void:deprecated_init_frame_pc_first:int fromleaf, struct frame_info *prev:fromleaf, prev
f:2:INIT_FRAME_PC:void:init_frame_pc:int fromleaf, struct frame_info *prev:fromleaf, prev:::init_frame_pc_default::0
#
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index c29c7a0..65216bd 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -5964,8 +5964,8 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_addr_bits_remove (gdbarch, mips_addr_bits_remove);
/* There's a mess in stack frame creation. See comments in
- blockframe.c near reference to INIT_FRAME_PC_FIRST. */
- set_gdbarch_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
+ blockframe.c near reference to DEPRECATED_INIT_FRAME_PC_FIRST. */
+ set_gdbarch_deprecated_init_frame_pc_first (gdbarch, mips_init_frame_pc_first);
set_gdbarch_init_frame_pc (gdbarch, init_frame_pc_noop);
/* Map debug register numbers onto internal register numbers. */
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 622f285..a558400 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1790,7 +1790,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_breakpoint_from_pc (gdbarch, s390_breakpoint_from_pc);
set_gdbarch_skip_prologue (gdbarch, s390_skip_prologue);
set_gdbarch_init_extra_frame_info (gdbarch, s390_init_extra_frame_info);
- set_gdbarch_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
+ set_gdbarch_deprecated_init_frame_pc_first (gdbarch, s390_init_frame_pc_first);
set_gdbarch_read_fp (gdbarch, s390_read_fp);
/* This function that tells us whether the function invocation represented
by FI does not have a frame on the stack associated with it. If it