aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-12-12 02:50:39 +0000
committerAndrew Cagney <cagney@redhat.com>1998-12-12 02:50:39 +0000
commit86a51f415d96f5ddeb8978b6bfe0e743689b670b (patch)
tree10cb3af9e25eccbc7ffd9adf8c48fe1ff0db996c /gdb/config
parent7381ab4534efc6778ed3d4d576fe9e70aa273951 (diff)
downloadgdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.zip
gdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.tar.gz
gdb-86a51f415d96f5ddeb8978b6bfe0e743689b670b.tar.bz2
CARP: Mechanism to replace EXTRA_FRAME_INFO.
Add two pointers (saved_regs, extra_info) to struct frame_info. Introduce new macro FRAME_INIT_SAVED_REGS which replaces FRAME_FIND_SAVED_REGS. Document. Use in mn10300 and rs6000 targets. Fix side effects on ALPHA, MIPS, Z8K and SPARC targets.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/a29k/tm-a29k.h2
-rw-r--r--gdb/config/mips/tm-mips.h8
-rw-r--r--gdb/config/mn10300/tm-mn10300.h7
-rw-r--r--gdb/config/rs6000/tm-rs6000.h91
-rw-r--r--gdb/config/sparc/tm-sparc.h2
-rw-r--r--gdb/config/z8k/tm-z8k.h5
6 files changed, 19 insertions, 96 deletions
diff --git a/gdb/config/a29k/tm-a29k.h b/gdb/config/a29k/tm-a29k.h
index 8d451d8..4892ec5 100644
--- a/gdb/config/a29k/tm-a29k.h
+++ b/gdb/config/a29k/tm-a29k.h
@@ -415,6 +415,8 @@ extern use_struct_convention_fn a29k_use_struct_convention;
void read_register_stack ();
long read_register_stack_integer ();
+#define FRAME_INIT_SAVED_REGS(fi) /*no-op*/
+
#define EXTRA_FRAME_INFO \
CORE_ADDR saved_msp; \
unsigned int rsize; \
diff --git a/gdb/config/mips/tm-mips.h b/gdb/config/mips/tm-mips.h
index fac4e14..bbc4e2b 100644
--- a/gdb/config/mips/tm-mips.h
+++ b/gdb/config/mips/tm-mips.h
@@ -380,12 +380,11 @@ extern int mips_frame_num_args PARAMS ((struct frame_info *));
ways in the stack frame. sp is even more special:
the address we return for it IS the sp for the next frame. */
-#define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
+#define FRAME_INIT_SAVED_REGS(frame_info) \
do { \
if ((frame_info)->saved_regs == NULL) \
mips_find_saved_regs (frame_info); \
- (frame_saved_regs) = *(frame_info)->saved_regs; \
- (frame_saved_regs).regs[SP_REGNUM] = (frame_info)->frame; \
+ (frame_info)->saved_regs[SP_REGNUM] = (frame_info)->frame; \
} while (0)
extern void mips_find_saved_regs PARAMS ((struct frame_info *));
@@ -455,8 +454,7 @@ typedef struct mips_extra_func_info {
#define EXTRA_FRAME_INFO \
mips_extra_func_info_t proc_desc; \
- int num_args;\
- struct frame_saved_regs *saved_regs;
+ int num_args;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) init_extra_frame_info(fci)
extern void init_extra_frame_info PARAMS ((struct frame_info *));
diff --git a/gdb/config/mn10300/tm-mn10300.h b/gdb/config/mn10300/tm-mn10300.h
index 94582ba..769924c 100644
--- a/gdb/config/mn10300/tm-mn10300.h
+++ b/gdb/config/mn10300/tm-mn10300.h
@@ -73,20 +73,15 @@ extern breakpoint_from_pc_fn mn10300_breakpoint_from_pc;
#ifdef __STDC__
struct frame_info;
-struct frame_saved_regs;
struct type;
struct value;
#endif
-#define EXTRA_FRAME_INFO struct frame_saved_regs fsr; int status; int stack_size;
-
extern void mn10300_init_extra_frame_info PARAMS ((struct frame_info *));
#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) mn10300_init_extra_frame_info (fi)
#define INIT_FRAME_PC /* Not necessary */
-extern void mn10300_frame_find_saved_regs PARAMS ((struct frame_info *,
- struct frame_saved_regs *));
-#define FRAME_FIND_SAVED_REGS(fi, regaddr) regaddr = fi->fsr
+#define FRAME_INIT_SAVED_REGS(fi) /* handled by init_extra_frame_info */
extern CORE_ADDR mn10300_frame_chain PARAMS ((struct frame_info *));
#define FRAME_CHAIN(fi) mn10300_frame_chain (fi)
diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h
index 0ea9bf6..10562f2 100644
--- a/gdb/config/rs6000/tm-rs6000.h
+++ b/gdb/config/rs6000/tm-rs6000.h
@@ -388,31 +388,12 @@ CORE_ADDR rs6000_frame_chain PARAMS ((struct frame_info *));
extern int frameless_function_invocation PARAMS((struct frame_info *));
-/* Functions calling alloca() change the value of the stack pointer. We
- need to use initial stack pointer (which is saved in r31 by gcc) in
- such cases. If a compiler emits traceback table, then we should use the
- alloca register specified in traceback table. FIXME. */
-/* Also, it is a good idea to cache information about frame's saved registers
- in the frame structure to speed things up. See tm-m88k.h. FIXME. */
-
-#define EXTRA_FRAME_INFO \
- CORE_ADDR initial_sp; /* initial stack pointer. */ \
- struct frame_saved_regs *cache_fsr; /* saved registers */
-
#define 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 */
-#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \
- fi->initial_sp = 0; \
- fi->cache_fsr = 0; \
- if (fi->next != (CORE_ADDR)0 \
- && fi->pc < TEXT_SEGMENT_BASE) \
- /* We're in get_prev_frame_info */ \
- /* and this is a special signal frame. */ \
- /* (fi->pc will be some low address in the kernel, */ \
- /* to which the signal handler returns). */ \
- fi->signal_handler_caller = 1;
+extern void rs6000_init_extra_frame_info (int fromleaf, struct frame_info *);
+#define INIT_EXTRA_FRAME_INFO(fromleaf, fi) rs6000_init_extra_frame_info (fromleaf, fi)
/* If the kernel has to deliver a signal, it pushes a sigcontext
structure on the stack and then calls the signal handler, passing
@@ -433,11 +414,8 @@ extern int frameless_function_invocation PARAMS((struct frame_info *));
extern unsigned long frame_saved_pc PARAMS ((struct frame_info *));
-#define FRAME_ARGS_ADDRESS(FI) \
- (((struct frame_info*)(FI))->initial_sp ? \
- ((struct frame_info*)(FI))->initial_sp : \
- frame_initial_stack_address (FI))
-extern CORE_ADDR frame_initial_stack_address PARAMS ((struct frame_info *));
+extern CORE_ADDR rs6000_frame_args_address PARAMS ((struct frame_info *));
+#define FRAME_ARGS_ADDRESS(FI) rs6000_frame_args_address (FI)
#define FRAME_LOCALS_ADDRESS(FI) FRAME_ARGS_ADDRESS(FI)
@@ -463,66 +441,9 @@ extern CORE_ADDR frame_initial_stack_address PARAMS ((struct frame_info *));
not sure if it will be needed. The following macro takes care of gpr's
and fpr's only. */
-#define FRAME_FIND_SAVED_REGS(FRAME_INFO, FRAME_SAVED_REGS) \
-{ \
- int ii; \
- CORE_ADDR frame_addr, func_start; \
- struct rs6000_framedata fdata; \
- \
- /* find the start of the function and collect info about its frame. */ \
- \
- func_start = get_pc_function_start ((FRAME_INFO)->pc) + FUNCTION_START_OFFSET; \
- (void) skip_prologue (func_start, &fdata); \
- memset (&(FRAME_SAVED_REGS), '\0', sizeof (FRAME_SAVED_REGS)); \
- \
- /* if there were any saved registers, figure out parent's stack pointer. */ \
- /* the following is true only if the frame doesn't have a call to alloca(), \
- FIXME. */ \
- if (fdata.saved_fpr == 0 && fdata.saved_gpr == 0 && \
- fdata.lr_offset == 0 && fdata.cr_offset == 0) { \
- frame_addr = 0; \
- \
- } else if ((FRAME_INFO)->prev && (FRAME_INFO)->prev->frame) { \
- frame_addr = (FRAME_INFO)->prev->frame; \
- \
- } else { \
- frame_addr = read_memory_integer ((FRAME_INFO)->frame, 4); \
- } \
- \
- /* if != -1, fdata.saved_fpr is the smallest number of saved_fpr. All \
- fpr's from saved_fpr to f31 are saved. */ \
- if (fdata.saved_fpr >= 0) { \
- int fpr_offset = frame_addr + fdata.fpr_offset; \
- for (ii = fdata.saved_fpr; ii < 32; ii++) { \
- (FRAME_SAVED_REGS).regs [FP0_REGNUM + ii] = fpr_offset; \
- fpr_offset += 8; \
- } \
- } \
- \
- /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr. All \
- gpr's from saved_gpr to r31 are saved. */ \
- if (fdata.saved_gpr >= 0) { \
- int gpr_offset = frame_addr + fdata.gpr_offset; \
- for (ii = fdata.saved_gpr; ii < 32; ii++) { \
- (FRAME_SAVED_REGS).regs [ii] = gpr_offset; \
- gpr_offset += 4; \
- } \
- } \
- \
- /* If != 0, fdata.cr_offset is the offset from the frame that holds \
- the CR */ \
- if (fdata.cr_offset != 0) { \
- (FRAME_SAVED_REGS).regs [CR_REGNUM] = frame_addr + fdata.cr_offset; \
- } \
- \
- /* If != 0, fdata.cr_offset is the offset from the frame that holds \
- the LR */ \
- if (fdata.lr_offset != 0) { \
- (FRAME_SAVED_REGS).regs [LR_REGNUM] = frame_addr + fdata.lr_offset; \
- } \
-}
+extern void rs6000_frame_init_saved_regs PARAMS ((struct frame_info *));
+#define FRAME_INIT_SAVED_REGS(FI) rs6000_frame_init_saved_regs (FI)
-
/* Things needed for making the inferior call functions. */
/* Push an empty stack frame, to record the current PC, etc. */
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index e3165ce..ecbe9e2 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -330,6 +330,8 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
/* time of the register saves. */ \
int sp_offset;
+#define FRAME_INIT_SAVED_REGS(fp) /*no-op*/
+
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
sparc_init_extra_frame_info (fromleaf, fci)
extern void sparc_init_extra_frame_info PARAMS((int, struct frame_info *));
diff --git a/gdb/config/z8k/tm-z8k.h b/gdb/config/z8k/tm-z8k.h
index 8ec1356..babde90 100644
--- a/gdb/config/z8k/tm-z8k.h
+++ b/gdb/config/z8k/tm-z8k.h
@@ -197,6 +197,11 @@ extern CORE_ADDR mz8k_skip_prologue PARAMS ((CORE_ADDR ip));
#define FRAME_ARGS_SKIP 8
+#ifdef __STDC__
+struct frame_info;
+#endif
+extern void z8k_frame_init_saved_regs PARAMS ((struct frame_info *));
+#define FRAME_INIT_SAVED_REGS(fi) z8k_frame_init_saved_regs (fi)
/* Things needed for making the inferior call functions.