From: Jim Blandy Date: Tue, 4 Dec 2001 23:51:55 +0000 (+0000) Subject: * s390-tdep.c (s390_get_frame_info): Doc fixes. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d8ba46bfd43f681b5b654dd6b8c89485dc9b8395;p=pf3gnuchains%2Fpf3gnuchains3x.git * s390-tdep.c (s390_get_frame_info): Doc fixes. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8a8fe7cecb..96e37e8881 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2001-12-04 Jim Blandy + + * s390-tdep.c (s390_get_frame_info): Doc fixes. + 2001-12-04 Orjan Friberg * cris-tdep.c (cris_regnums): Add DCCR_REGNUM for completeness. diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index f91b696345..e0ea2af021 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -208,8 +208,7 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, 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 const_pool_state; int frame_pointer_found, varargs_state; int loop_cnt, gdb_gpr_store, gdb_fpr_store; int frame_pointer_regidx = 0xf; @@ -217,6 +216,29 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, 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,7 +515,8 @@ s390_get_frame_info (CORE_ADDR pc, struct frame_extra_info *fextra_info, /* Alternatively check for the complex construction for buying more than 32k of stack BRAS gprx,.+8 - long vals %r15,0(%gprx) gprx currently r1 */ + 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))