This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
PATCH: S/390: document frame link state machine
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 4 Dec 2001 19:10:06 -0500 (EST)
- Subject: PATCH: S/390: document frame link state machine
2001-12-04 Jim Blandy <jimb@redhat.com>
* s390-tdep.c (s390_get_frame_info): Doc fixes.
Index: gdb/s390-tdep.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/s390-tdep.c,v
retrieving revision 2.24
diff -c -r2.24 s390-tdep.c
*** gdb/s390-tdep.c 2001/12/03 18:50:57 2.24
--- gdb/s390-tdep.c 2001/12/04 23:48:44
***************
*** 208,215 ****
int gprs_saved[S390_NUM_GPRS];
int fprs_saved[S390_NUM_FPRS];
int regidx, instrlen;
! int save_link_regidx, subtract_sp_regidx;
! int const_pool_state, save_link_state;
int frame_pointer_found, varargs_state;
int loop_cnt, gdb_gpr_store, gdb_fpr_store;
int frame_pointer_regidx = 0xf;
--- 208,214 ----
int gprs_saved[S390_NUM_GPRS];
int fprs_saved[S390_NUM_FPRS];
int regidx, instrlen;
! int const_pool_state;
int frame_pointer_found, varargs_state;
int loop_cnt, gdb_gpr_store, gdb_fpr_store;
int frame_pointer_regidx = 0xf;
***************
*** 217,222 ****
--- 216,244 ----
int err = 0;
disassemble_info info;
+ /* What we've seen so far regarding saving the back chain link:
+ 0 -- nothing yet; sp still has the same value it had at the entry
+ point. Since not all functions allocate frames, this is a
+ valid state for the prologue to finish in.
+ 1 -- We've saved the original sp in some register other than the
+ frame pointer (hard-coded to be %r11, yuck).
+ save_link_regidx is the register we saved it in.
+ 2 -- We've seen the initial `bras' instruction of the sequence for
+ reserving more than 32k of stack:
+ bras %rX, .+8
+ .long N
+ s %r15, 0(%rX)
+ where %rX is not the constant pool register.
+ subtract_sp_regidx is %rX, and fextra_info->stack_bought is N.
+ 3 -- We've reserved space for a new stack frame. This means we
+ either saw a simple `ahi %r15,-N' in state 1, or the final
+ `s %r15, ...' in state 2.
+ 4 -- The frame and link are now fully initialized. We've
+ reserved space for the new stack frame, and stored the old
+ stack pointer captured in the back chain pointer field. */
+ int save_link_state;
+ int save_link_regidx, subtract_sp_regidx;
+
/* What we've seen so far regarding r12 --- the GOT (Global Offset
Table) pointer. We expect to see `l %r12, N(%r13)', which loads
r12 with the offset from the constant pool to the GOT, and then
***************
*** 493,499 ****
/* Alternatively check for the complex construction for
buying more than 32k of stack
BRAS gprx,.+8
! long vals %r15,0(%gprx) gprx currently r1 */
if ((save_link_state == 1) && (instr[0] == 0xa7)
&& ((instr[1] & 0xf) == 0x5) && (instr[2] == 0)
&& (instr[3] == 0x4) && ((instr[1] >> 4) != CONST_POOL_REGIDX))
--- 515,522 ----
/* Alternatively check for the complex construction for
buying more than 32k of stack
BRAS gprx,.+8
! long val
! s %r15,0(%gprx) gprx currently r1 */
if ((save_link_state == 1) && (instr[0] == 0xa7)
&& ((instr[1] & 0xf) == 0x5) && (instr[2] == 0)
&& (instr[3] == 0x4) && ((instr[1] >> 4) != CONST_POOL_REGIDX))