public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/43828]  New: Emit debug info allowing inlined functions to show in stack traces
@ 2010-04-21  9:26 scovich at gmail dot com
  2010-04-21  9:29 ` [Bug debug/43828] " scovich at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: scovich at gmail dot com @ 2010-04-21  9:26 UTC (permalink / raw)
  To: gcc-bugs

It would be very nice if gcc emitted debug information that allowed profilers
and debuggers the option to extract a stack trace which included calls to
inlined functions. This would allow developers much greater insight into the
behavior of optimized code. 

C++ programs would benefit disproportionately, especially those which use the
STL heavily -- disabling inlining produces a very different executable which
makes profiling worse than useless and can mask heisenbugs.

Profiling would become significantly more accurate because it could determine
how much of a function's overheads remain even after inlining, which is pretty
much impossible right now. It would also allow profilers to generate
"functional" call graphs which show all uses of a function, inlined or not. 

Debugging would also improve because the user would be able to navigate a stack
trace which corresponds to the code they're trying to debug, even if the actual
calls were optimized away. Questions like "which of this function's 10 calls to
std::vector::begin seg faulted?" would suddenly be *much* easier to answer, and
in an intuitive way. With some work it would probably even be possible to
maintain mappings for local vars/params (assuming they exist at the time). 

All this "virtual stack trace" functionality would need to remain separate (and
probably not the default) so as to not confuse (impede) folks who are used to
(prefer) the current behavior. 

NOTE: I realize that full support for this would require changes to other
projects like gdb and gprof, but gcc could solve the chicken-and-egg problem by
emitting appropriate debug info as a first step; perhaps the new debug info
changes introduced with 4.5.0 already do (some of) this?


-- 
           Summary: Emit debug info allowing inlined functions to show in
                    stack traces
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: scovich at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43828


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-05-07 21:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21  9:26 [Bug debug/43828] New: Emit debug info allowing inlined functions to show in stack traces scovich at gmail dot com
2010-04-21  9:29 ` [Bug debug/43828] " scovich at gmail dot com
2010-04-21 10:03 ` jakub at gcc dot gnu dot org
2010-04-23 22:40 ` wilson at codesourcery dot com
2010-04-23 23:30 ` scovich at gmail dot com
2010-05-07 20:12 ` scovich at gmail dot com
2010-05-07 21:20 ` scovich at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).