aboutsummaryrefslogtreecommitdiff
path: root/gdb/config
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-12-18 06:59:12 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-12-18 06:59:12 +0000
commitee7b9e92f6c3749b4657986ba2c3bfeb87d608c5 (patch)
tree35c8201b2c173aa44013e1749453bafb4530a863 /gdb/config
parent4ec56c1fec7ba696ba78aef44fdb646bcf8488c7 (diff)
downloadgdb-ee7b9e92f6c3749b4657986ba2c3bfeb87d608c5.zip
gdb-ee7b9e92f6c3749b4657986ba2c3bfeb87d608c5.tar.gz
gdb-ee7b9e92f6c3749b4657986ba2c3bfeb87d608c5.tar.bz2
* tm-sparc.c (EXTRA_FRAME_INFO): New field sp_offset.
* sparc-tdep.c (sparc_init_extra_frame_info): Set it. (examine_prologue, sparc_init_extra_frame_info): Use ->frame plus ->sp_offset to compute the address something is saved at, not ->bottom. * sparc-tdep.c (get_saved_register): New function. * tm-sparc.h: Define GET_SAVED_REGISTER; don't define FRAME_FIND_SAVED_REGS, HAVE_REGISTER_WINDOWS or REGISTER_IN_WINDOW_P. * stack.c (frame_info): Add comment about what to do if FRAME_FIND_SAVED_REGS is not defined. * sparc-tdep.c (sparc_init_extra_frame_info): Set ->frame field here. Get it right for flat frames. * sparc-tdep.c (sparc_frame_chain): Instead of returning meaningful value for ->frame field, just return dummy value. This change is needed because the old code didn't deal with mixed flat and non-flat frames. * sparc-tdep.c (sparc_pop_frame): Write SP_REGNUM from frame->frame, don't go through saved regs for this. * sparc-tdep.c: Move guts of skip_prologue to new function examine_prologue. Check for flat prologue and set is_flat. Provide the caller with the information about what is saved where if desired. (skip_prologue, sparc_frame_find_saved_regs): Call examine_prologue. * sparc-tdep.c: Replace union sparc_insn_layout and anonymous union in isannulled, which won't work on a little-endian host, with X_* macros. * sparc-tdep.c (sparc_frame_saved_pc): If addr == 0, the saved PC is still in %o7. * config/sparc/tm-sparc.h: Define INIT_FRAME_PC and INIT_FRAME_PC_FIRST. * blockframe.c (get_prev_frame_info): Modify comments regarding INIT_FRAME_PC_FIRST and the sparc. * sparc-tdep.c (single_step): Use 4 not sizeof (long) for size of instruction.
Diffstat (limited to 'gdb/config')
-rw-r--r--gdb/config/sparc/tm-sparc.h50
1 files changed, 23 insertions, 27 deletions
diff --git a/gdb/config/sparc/tm-sparc.h b/gdb/config/sparc/tm-sparc.h
index 36fb4e6..de0956e 100644
--- a/gdb/config/sparc/tm-sparc.h
+++ b/gdb/config/sparc/tm-sparc.h
@@ -187,11 +187,12 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
register state, the array `registers'. On the sparc, `registers'
contains the ins and locals, even though they are saved on the
stack rather than with the other registers, and this causes hair
- and confusion in places like pop_frame. It probably would be
+ and confusion in places like pop_frame. It might be
better to remove the ins and locals from `registers', make sure
that get_saved_register can get them from the stack (even in the
innermost frame), and make this the way to access them. For the
- frame pointer we would do that via TARGET_READ_FP. */
+ frame pointer we would do that via TARGET_READ_FP. On the other hand,
+ that is likely to be confusing or worse for flat frames. */
#define REGISTER_BYTES (32*4+32*4+8*4)
@@ -200,18 +201,11 @@ extern CORE_ADDR sparc_pc_adjust PARAMS ((CORE_ADDR));
/* ?? */
#define REGISTER_BYTE(N) ((N)*4)
-/* The SPARC processor has register windows. */
+/* We need to override GET_SAVED_REGISTER so that we can deal with the way
+ outs change into ins in different frames. HAVE_REGISTER_WINDOWS can't
+ deal with this case and also handle flat frames at the same time. */
-#define HAVE_REGISTER_WINDOWS
-
-/* Is this register part of the register window system? A yes answer
- implies that 1) The name of this register will not be the same in
- other frames, and 2) This register is automatically "saved" (out
- registers shifting into ins counts) upon subroutine calls and thus
- there is no need to search more than one stack frame for it. */
-
-#define REGISTER_IN_WINDOW_P(regnum) \
- ((regnum) >= 8 && (regnum) < 32)
+#define GET_SAVED_REGISTER 1
/* Number of bytes of storage in the actual machine representation
for register N. */
@@ -342,8 +336,12 @@ sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
#define EXTRA_FRAME_INFO \
CORE_ADDR bottom; \
int flat; \
+ /* Following fields only relevant for flat frames. */ \
CORE_ADDR pc_addr; \
CORE_ADDR fp_addr; \
+ /* Add this to ->frame to get the value of the stack pointer at the */ \
+ /* time of the register saves. */ \
+ int sp_offset;
#define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
sparc_init_extra_frame_info (fromleaf, fci)
@@ -356,8 +354,19 @@ extern void sparc_init_extra_frame_info ();
(fi)->pc_addr, (fi)->fp_addr); \
}
+#ifdef __STDC__
+struct frame_info;
+#endif
+
#define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
-extern CORE_ADDR sparc_frame_chain ();
+extern CORE_ADDR sparc_frame_chain PARAMS ((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) \
+ (prev)->pc = ((fromleaf) ? SAVED_PC_AFTER_CALL ((prev)->next) : \
+ (prev)->next ? FRAME_SAVED_PC ((prev)->next) : read_pc ());
/* Define other aspects of the stack frame. */
@@ -397,19 +406,6 @@ extern CORE_ADDR sparc_frame_saved_pc ();
/* Return number of bytes at start of arglist that are not really args. */
#define FRAME_ARGS_SKIP 68
-
-/* Put here the code to store, into a struct frame_saved_regs,
- the addresses of the saved registers of frame described by FRAME_INFO.
- The actual code is in sparc-tdep.c so we can debug it sanely. */
-
-#define FRAME_FIND_SAVED_REGS(fi, frame_saved_regs) \
- sparc_frame_find_saved_regs ((fi), &(frame_saved_regs))
-#ifdef __STDC__
-struct frame_info;
-struct frame_saved_regs;
-#endif
-extern void sparc_frame_find_saved_regs PARAMS ((struct frame_info *,
- struct frame_saved_regs *));
/* Things needed for making the inferior call functions. */
/*