Index: blockframe.c =================================================================== RCS file: /cvs/src/src/gdb/blockframe.c,v retrieving revision 1.29 diff -u -3 -p -r1.29 blockframe.c --- blockframe.c 8 Jun 2002 18:30:14 -0000 1.29 +++ blockframe.c 20 Jun 2002 19:54:13 -0000 @@ -970,6 +970,7 @@ block_innermost_frame (struct block *blo struct frame_info *frame; register CORE_ADDR start; register CORE_ADDR end; + int innermost; if (block == NULL) return NULL; @@ -983,7 +984,18 @@ block_innermost_frame (struct block *blo frame = get_prev_frame (frame); if (frame == NULL) return NULL; - if (frame->pc >= start && frame->pc < end) + /* To evaluate if a given PC address is within a block range, + we normally check if PC is inside [block start .. block end[. + However, If FRAME is not the innermost frame, then frame->pc + normally points to the instruction *following* the call, which + means that the comparison with the block boundaries need to be + offset by one instruction. This is done by checking if PC is + inside ]block start .. block end] instead. */ + innermost = !frame->next + || frame->next->signal_handler_caller + || frame_in_dummy (frame->next); + if ((innermost && frame->pc >= start && frame->pc < end) + || (!innermost && frame->pc > start && frame->pc <= end)) return frame; } }