It would be desirable to have a DWARF marker of some sort emitted for the point(s) of a function that correspond to the logical moment of its return. This would ideally be a point where all the nearby variables are still in scope, so the last-gasp variable state may be examined. Ideally, tail call sites would also have this marker, and so would inlined functions. One can dream...
(In reply to comment #0) > Ideally, tail call sites would also have this marker, and so would > inlined functions. One can dream... Besides nearby variables, we'd also like to know what is the imminent return value. I imagine that's fine for a typical function, and perhaps for inlines too if optimization didn't morph it away. But it's not clear to me how DWARF could help us with the return value from a tail call. If the callee is statically known, then perhaps some indirection to that site, but in general I don't know...
For tail calls, you have in GCC 4.7 (and 4.6-RH in Fedora 16) the DW_TAG_GNU_call_site* stuff from which you can (sometimes) reconstruct the actual backtrace. The return value from the function that tail called another one is by definition the same as from the tail callee.
test comment
Alexandre, did you just get assigned this because that's what happens with all bugs with the "debug" component, or are you actually working on it?
I've been working on an off on this specific issue, and on various surrounding infrastructure issues, for a very long time. Right now I'm not specifically working on it.
(In reply to Alexandre Oliva from comment #5) > I've been working on an off on this specific issue, and on various > surrounding infrastructure issues, for a very long time. Right now I'm not > specifically working on it. ok, taking the "right now" part as the operative part and moving you from the assignee slot to the cc list