[RFC] frame_id_inner check and -fsplit-stack

Joel Brobecker brobecker@adacore.com
Tue Dec 29 19:07:00 GMT 2009


Ian Taylor just reported on the GDB IRC that the frame_id_inner
check in get_prev_frame_1 is making debugging difficult when
the program has been built with -fsplit-stack. This option
<<permits discontiguous stack segments. The stack segments are
just allocated using mmap, so there is no particular ordering>>.
As a result, if two frames are on different stack segments,
the ordering of the segments might be such that two valid frames
might be failing the frame_id_inner check.

Discussing with Ian, he indicated that it should be easy to produce
a section with magic name. This would allow us to determine that
the program uses split-stack and that the frame_id_inner may not
apply.

I can see the following options:

  1. do nothing (ahem);
  2. remove the check entirely; we currently apply it I think
     when the two frames are normal frames.  We already skip it
     when either frame is not normal.
  3. provide a user setting that allows the user to tell GDB
     that the program uses split stacks;
  4. skip the test when split stacks is detected.

I don't think we should really consider option (3) if we can indeed
easily detect split-stack. (1) seems a bit harsh. I am Ok with either
(2) or (4). It sounds like Ian is willing to make it easy for us to
detect split-stack, so I'd vote for (4).  Given that nearly all the code
we debug does not use split-stack, we can keep the frame_id_inner check
a while longer...

Thoughts?

-- 
Joel



More information about the Gdb-patches mailing list