This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] deprecate frame {args,locals} address
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 25 Jun 2003 20:24:59 -0400
- Subject: [patch] deprecate frame {args,locals} address
More clarifying of what is where, will commit in a few days and _not_
to the branch.
Andrew
2003-06-25 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (FRAME_ARGS_ADDRESS): Add predicate. Deprecate.
(FRAME_LOCALS_ADDRESS): Add predicate. Deprecate.
* gdbarch.h, gdbarch.c: Re-generate.
* frame-base.c (default_frame_args_address): Update. Use
default_frame_base_address when DEPRECATED_FRAME_ARGS_ADDRESS is
not available.
(default_frame_locals_address): Ditto for
DEPRECATED_FRAME_LOCALS_ADDRESS.
* vax-tdep.c (vax_sigtramp_saved_pc): Update.
(vax_frame_num_args): Update.
(vax_gdbarch_init): Update.
* rs6000-tdep.c (rs6000_gdbarch_init): Update.
* ns32k-tdep.c (ns32k_gdbarch_init): Update.
* mcore-tdep.c (mcore_gdbarch_init): Update.
* m68hc11-tdep.c (m68hc11_gdbarch_init): Update.
* ia64-tdep.c (ia64_gdbarch_init): Update.
* symtab.h (address_class): Update comments.
* ns32k-tdep.c (ns32k_sigtramp_saved_pc): Update.
* config/sparc/tm-sparc.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update.
(DEPRECATED_FRAME_LOCALS_ADDRESS): Update.
* config/pa/tm-hppa64.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update.
(DEPRECATED_FRAME_LOCALS_ADDRESS): Update.
(DEPRECATED_FRAME_LOCALS_ADDRESS): Update.
* config/m68k/tm-delta68.h (DEPRECATED_FRAME_ARGS_ADDRESS): Update.
* alpha-mdebug-tdep.c: Update.
* ada-lang.c (add_symbols_from_enclosing_procs): Update.
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.30
diff -u -r1.30 ada-lang.c
--- ada-lang.c 17 Jun 2003 21:20:41 -0000 1.30
+++ ada-lang.c 26 Jun 2003 00:09:40 -0000
@@ -3559,7 +3559,7 @@
QUIT;
frame = get_prev_frame (frame);
}
- while (frame != NULL && FRAME_LOCALS_ADDRESS (frame) != target_link);
+ while (frame != NULL && DEPRECATED_FRAME_LOCALS_ADDRESS (frame) != target_link);
if (frame == NULL)
break;
Index: alpha-mdebug-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.5
diff -u -r1.5 alpha-mdebug-tdep.c
--- alpha-mdebug-tdep.c 4 Jun 2003 16:44:29 -0000 1.5
+++ alpha-mdebug-tdep.c 26 Jun 2003 00:09:41 -0000
@@ -45,7 +45,7 @@
| |localoff | Copies of 1st .. 6th |
| | | | | argument if necessary. |
| | | v | |
- | | | --- |-------------------------------|<-- FRAME_LOCALS_ADDRESS
+ | | | --- |-------------------------------|<-- LOCALS_ADDRESS
| | | | |
| | | | Locals and temporaries. |
| | | | |
Index: frame-base.c
===================================================================
RCS file: /cvs/src/src/gdb/frame-base.c,v
retrieving revision 1.4
diff -u -r1.4 frame-base.c
--- frame-base.c 11 Jun 2003 13:16:27 -0000 1.4
+++ frame-base.c 26 Jun 2003 00:09:41 -0000
@@ -24,9 +24,9 @@
#include "frame.h"
/* A default frame base implementations. If it wasn't for the old
- FRAME_LOCALS_ADDRESS and FRAME_ARGS_ADDRESS, these could be
- combined into a single function. All architectures really need to
- override this. */
+ DEPRECATED_FRAME_LOCALS_ADDRESS and DEPRECATED_FRAME_ARGS_ADDRESS,
+ these could be combined into a single function. All architectures
+ really need to override this. */
static CORE_ADDR
default_frame_base_address (struct frame_info *next_frame, void **this_cache)
@@ -38,15 +38,25 @@
static CORE_ADDR
default_frame_locals_address (struct frame_info *next_frame, void **this_cache)
{
- struct frame_info *this_frame = get_prev_frame (next_frame);
- return FRAME_LOCALS_ADDRESS (this_frame);
+ if (DEPRECATED_FRAME_LOCALS_ADDRESS_P ())
+ {
+ /* This is bad. The computation of per-frame locals address
+ should use a per-frame frame-base. */
+ struct frame_info *this_frame = get_prev_frame (next_frame);
+ return DEPRECATED_FRAME_LOCALS_ADDRESS (this_frame);
+ }
+ return default_frame_base_address (next_frame, this_cache);
}
static CORE_ADDR
default_frame_args_address (struct frame_info *next_frame, void **this_cache)
{
- struct frame_info *this_frame = get_prev_frame (next_frame);
- return FRAME_ARGS_ADDRESS (this_frame);
+ if (DEPRECATED_FRAME_ARGS_ADDRESS_P ())
+ {
+ struct frame_info *this_frame = get_prev_frame (next_frame);
+ return DEPRECATED_FRAME_ARGS_ADDRESS (this_frame);
+ }
+ return default_frame_base_address (next_frame, this_cache);
}
const struct frame_base default_frame_base = {
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.252
diff -u -r1.252 gdbarch.sh
--- gdbarch.sh 19 Jun 2003 15:04:55 -0000 1.252
+++ gdbarch.sh 26 Jun 2003 00:09:54 -0000
@@ -631,8 +631,12 @@
F:2:DEPRECATED_FRAME_SAVED_PC:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi::0:0
M::UNWIND_PC:CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame:
M::UNWIND_SP:CORE_ADDR:unwind_sp:struct frame_info *next_frame:next_frame:
-f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0
-f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0
+# DEPRECATED_FRAME_ARGS_ADDRESS as been replaced by the per-frame
+# frame-base. Enable frame-base before frame-unwind.
+F::DEPRECATED_FRAME_ARGS_ADDRESS:CORE_ADDR:deprecated_frame_args_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
+# DEPRECATED_FRAME_LOCALS_ADDRESS as been replaced by the per-frame
+# frame-base. Enable frame-base before frame-unwind.
+F::DEPRECATED_FRAME_LOCALS_ADDRESS:CORE_ADDR:deprecated_frame_locals_address:struct frame_info *fi:fi::get_frame_base:get_frame_base
F::DEPRECATED_SAVED_PC_AFTER_CALL:CORE_ADDR:deprecated_saved_pc_after_call:struct frame_info *frame:frame
F:2:FRAME_NUM_ARGS:int:frame_num_args:struct frame_info *frame:frame
#
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.89
diff -u -r1.89 ia64-tdep.c
--- ia64-tdep.c 16 Jun 2003 16:47:42 -0000 1.89
+++ ia64-tdep.c 26 Jun 2003 00:09:55 -0000
@@ -2296,8 +2296,8 @@
set_gdbarch_deprecated_call_dummy_words (gdbarch, ia64_call_dummy_words);
set_gdbarch_deprecated_sizeof_call_dummy_words (gdbarch, sizeof (ia64_call_dummy_words));
set_gdbarch_deprecated_init_extra_frame_info (gdbarch, ia64_init_extra_frame_info);
- set_gdbarch_frame_args_address (gdbarch, ia64_frame_args_address);
- set_gdbarch_frame_locals_address (gdbarch, ia64_frame_locals_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, ia64_frame_args_address);
+ set_gdbarch_deprecated_frame_locals_address (gdbarch, ia64_frame_locals_address);
/* We won't necessarily have a frame pointer and even if we do, it
winds up being extraordinarly messy when attempting to find the
Index: m68hc11-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m68hc11-tdep.c,v
retrieving revision 1.76
diff -u -r1.76 m68hc11-tdep.c
--- m68hc11-tdep.c 13 Jun 2003 04:40:32 -0000 1.76
+++ m68hc11-tdep.c 26 Jun 2003 00:09:55 -0000
@@ -1386,7 +1386,7 @@
set_gdbarch_deprecated_frame_chain (gdbarch, m68hc11_frame_chain);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc);
- set_gdbarch_frame_args_address (gdbarch, m68hc11_frame_args_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, m68hc11_frame_args_address);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, m68hc11_saved_pc_after_call);
set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
Index: mcore-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mcore-tdep.c,v
retrieving revision 1.70
diff -u -r1.70 mcore-tdep.c
--- mcore-tdep.c 16 Jun 2003 16:47:42 -0000 1.70
+++ mcore-tdep.c 26 Jun 2003 00:09:56 -0000
@@ -1101,8 +1101,8 @@
mcore_extract_struct_value_address);
set_gdbarch_skip_prologue (gdbarch, mcore_skip_prologue);
set_gdbarch_frame_args_skip (gdbarch, 0);
- set_gdbarch_frame_args_address (gdbarch, mcore_frame_args_address);
- set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, mcore_frame_args_address);
+ set_gdbarch_deprecated_frame_locals_address (gdbarch, mcore_frame_locals_address);
set_gdbarch_deprecated_pop_frame (gdbarch, mcore_pop_frame);
set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer);
Index: ns32k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ns32k-tdep.c,v
retrieving revision 1.53
diff -u -r1.53 ns32k-tdep.c
--- ns32k-tdep.c 13 Jun 2003 04:40:33 -0000 1.53
+++ ns32k-tdep.c 26 Jun 2003 00:09:56 -0000
@@ -327,7 +327,7 @@
/* Get sigcontext address, it is the third parameter on the stack. */
if (get_next_frame (frame))
sigcontext_addr = read_memory_typed_address
- (FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs,
+ (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame)) + FRAME_ARGS_SKIP + sigcontext_offs,
builtin_type_void_data_ptr);
else
sigcontext_addr = read_memory_typed_address
@@ -569,7 +569,7 @@
set_gdbarch_deprecated_frame_chain (gdbarch, ns32k_frame_chain);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, ns32k_frame_saved_pc);
- set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, ns32k_frame_args_address);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ns32k_frame_init_saved_regs);
Index: rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.145
diff -u -r1.145 rs6000-tdep.c
--- rs6000-tdep.c 16 Jun 2003 16:47:42 -0000 1.145
+++ rs6000-tdep.c 26 Jun 2003 00:10:11 -0000
@@ -2995,8 +2995,8 @@
set_gdbarch_convert_from_func_ptr_addr (gdbarch,
rs6000_convert_from_func_ptr_addr);
}
- set_gdbarch_frame_args_address (gdbarch, rs6000_frame_args_address);
- set_gdbarch_frame_locals_address (gdbarch, rs6000_frame_args_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, rs6000_frame_args_address);
+ set_gdbarch_deprecated_frame_locals_address (gdbarch, rs6000_frame_args_address);
set_gdbarch_deprecated_saved_pc_after_call (gdbarch, rs6000_saved_pc_after_call);
/* Helpers for function argument information. */
Index: symtab.h
===================================================================
RCS file: /cvs/src/src/gdb/symtab.h,v
retrieving revision 1.75
diff -u -r1.75 symtab.h
--- symtab.h 12 Jun 2003 15:33:45 -0000 1.75
+++ symtab.h 26 Jun 2003 00:10:17 -0000
@@ -394,8 +394,9 @@
/* Value is in register number SYMBOL_VALUE. Just like LOC_REGISTER
except this is an argument. Probably the cleaner way to handle
this would be to separate address_class (which would include
- separate ARG and LOCAL to deal with FRAME_ARGS_ADDRESS versus
- FRAME_LOCALS_ADDRESS), and an is_argument flag.
+ separate ARG and LOCAL to deal with the frame's arguments
+ (get_frame_args_address) versus the frame's locals
+ (get_frame_locals_address), and an is_argument flag.
For some symbol formats (stabs, for some compilers at least),
the compiler generates two symbols, an argument and a register.
@@ -439,9 +440,9 @@
/* Value is arg at SYMBOL_VALUE offset in stack frame. Differs from
LOC_LOCAL in that symbol is an argument; differs from LOC_ARG in
- that we find it in the frame (FRAME_LOCALS_ADDRESS), not in the
- arglist (FRAME_ARGS_ADDRESS). Added for i960, which passes args
- in regs then copies to frame. */
+ that we find it in the frame (get_frame_locals_address), not in
+ the arglist (get_frame_args_address). Added for i960, which
+ passes args in regs then copies to frame. */
LOC_LOCAL_ARG,
Index: vax-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/vax-tdep.c,v
retrieving revision 1.57
diff -u -r1.57 vax-tdep.c
--- vax-tdep.c 13 Jun 2003 04:40:34 -0000 1.57
+++ vax-tdep.c 26 Jun 2003 00:10:19 -0000
@@ -38,8 +38,6 @@
static gdbarch_skip_prologue_ftype vax_skip_prologue;
static gdbarch_frame_num_args_ftype vax_frame_num_args;
static gdbarch_deprecated_frame_chain_ftype vax_frame_chain;
-static gdbarch_frame_args_address_ftype vax_frame_args_address;
-static gdbarch_frame_locals_address_ftype vax_frame_locals_address;
static gdbarch_deprecated_extract_return_value_ftype vax_extract_return_value;
static gdbarch_deprecated_extract_struct_value_address_ftype
@@ -136,7 +134,7 @@
/* Get sigcontext address, it is the third parameter on the stack. */
if (get_next_frame (frame))
sigcontext_addr = read_memory_typed_address
- (FRAME_ARGS_ADDRESS (get_next_frame (frame))
+ (DEPRECATED_FRAME_ARGS_ADDRESS (get_next_frame (frame))
+ FRAME_ARGS_SKIP + sigcontext_offs,
builtin_type_void_data_ptr);
else
@@ -181,7 +179,7 @@
static int
vax_frame_num_args (struct frame_info *fi)
{
- return (0xff & read_memory_integer (FRAME_ARGS_ADDRESS (fi), 1));
+ return (0xff & read_memory_integer (DEPRECATED_FRAME_ARGS_ADDRESS (fi), 1));
}
static CORE_ADDR
@@ -380,7 +378,7 @@
set_gdbarch_deprecated_frame_chain (gdbarch, vax_frame_chain);
set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc);
- set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address);
+ set_gdbarch_deprecated_frame_args_address (gdbarch, vax_frame_args_address);
set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, vax_frame_init_saved_regs);
Index: config/m68k/tm-delta68.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/tm-delta68.h,v
retrieving revision 1.11
diff -u -r1.11 tm-delta68.h
--- config/m68k/tm-delta68.h 11 Jun 2003 19:38:27 -0000 1.11
+++ config/m68k/tm-delta68.h 26 Jun 2003 00:10:19 -0000
@@ -105,5 +105,5 @@
#define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi);
-#undef FRAME_ARGS_ADDRESS
-#define FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi)
+#undef DEPRECATED_FRAME_ARGS_ADDRESS
+#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) delta68_frame_args_address (fi)
Index: config/pa/tm-hppa64.h
===================================================================
RCS file: /cvs/src/src/gdb/config/pa/tm-hppa64.h,v
retrieving revision 1.21
diff -u -r1.21 tm-hppa64.h
--- config/pa/tm-hppa64.h 9 Jun 2003 17:35:59 -0000 1.21
+++ config/pa/tm-hppa64.h 26 Jun 2003 00:10:23 -0000
@@ -283,12 +283,12 @@
#if !GDB_MULTI_ARCH
extern CORE_ADDR hppa_frame_args_address (struct frame_info *fi);
-#define FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
+#define DEPRECATED_FRAME_ARGS_ADDRESS(fi) hppa_frame_args_address (fi)
#endif
#if !GDB_MULTI_ARCH
extern CORE_ADDR hppa_frame_locals_address (struct frame_info *fi);
-#define FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) hppa_frame_locals_address (fi)
#endif
#if !GDB_MULTI_ARCH
@@ -445,8 +445,8 @@
/* We access locals from SP. This may not work for frames which call
alloca; for those, we may need to consult unwind tables.
jimb: FIXME. */
-#undef FRAME_LOCALS_ADDRESS
-#define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
+#undef DEPRECATED_FRAME_LOCALS_ADDRESS
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
/* For a number of horrible reasons we may have to adjust the location
of variables on the stack. Ugh. jimb: why? */
Index: config/sparc/tm-sparc.h
===================================================================
RCS file: /cvs/src/src/gdb/config/sparc/tm-sparc.h,v
retrieving revision 1.53
diff -u -r1.53 tm-sparc.h
--- config/sparc/tm-sparc.h 9 Jun 2003 17:35:59 -0000 1.53
+++ config/sparc/tm-sparc.h 26 Jun 2003 00:10:39 -0000
@@ -441,9 +441,9 @@
extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
/* If the argument is on the stack, it will be here. */
-#define FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
+#define DEPRECATED_FRAME_ARGS_ADDRESS(FI) (get_frame_base (FI))
-#define FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
+#define DEPRECATED_FRAME_LOCALS_ADDRESS(FI) (get_frame_base (FI))
/* Set VAL to the number of args passed to frame described by FI.
Can set VAL to -1, meaning no way to tell. */