This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: Re: tdep/1155: s/390 Linux: GDB can't reselect the rightframe after an inferior function call]



The original bug, as filed, said:


<quote>
If you ask GDB to make an inferior function call when the youngest
frame is a frameless function, and the selected frame is the
second-to-youngest frame, then GDB will not properly re-select the
second-to-youngest frame when the inferior call returns.

On the S/390, if a function doesn't use alloca, then the compiler just
uses the stack pointer as the frame pointer.  This means that GDB's
frame_info structures use the address of the low end of the frame as
the frame base, not the high end.  (The S/390 stack grows downwards.)
So, if the youngest function call hasn't allocated any stack space,
then its frame base address is equal to that of its caller. This means
that frame_find_by_id is unable to distinguish between the two.
</quote>

In what way do you see this problem as resolved?

Just to close this, further analysis revealed that the s390's frame ID's stack address wasn't correct (wasn't constant, pointing at the wrong end of the frame). Fixing that will fix the above.


It's also useful to note that, in the critical edge cases, GDB is already doing frame/func comparisons vis:
case PRINT_UNKNOWN:
/* FIXME: cagney/2002-12-01: Given that a frame ID does
(or should) carry around the function and does (or
should) use that when doing a frame comparison. */
if (stop_step
&& frame_id_eq (step_frame_id,
get_frame_id (get_current_frame ()))
&& step_start_function == find_pc_function (stop_pc))
Moving the test to frame_id_eq() is something of a clean up. It will also make it possible to flush out all those remaining edge cases though.


Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]