Bug 49167 - dwarf marker for function return instruction
Summary: dwarf marker for function return instruction
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks:
 
Reported: 2011-05-25 21:34 UTC by Frank Ch. Eigler
Modified: 2021-10-02 09:16 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2011-05-25 21:34:56 UTC
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...
Comment 1 Josh Stone 2011-06-03 18:56:06 UTC
(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...
Comment 2 Jakub Jelinek 2011-06-03 19:09:04 UTC
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.
Comment 3 Frank Ch. Eigler 2012-05-22 14:30:35 UTC
test comment
Comment 4 Eric Gallager 2018-12-15 03:45:44 UTC
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?
Comment 5 Alexandre Oliva 2018-12-29 03:41:17 UTC
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.
Comment 6 Eric Gallager 2019-03-29 05:34:57 UTC
(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