This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch] better dwarf2 debug info for inlined functions


On 7/7/05, James E Wilson <wilson@specifix.com> wrote:
> This patch improves the debug info generated for inlined function
> calls.  This is related to the binutils bug 947 and the gcc bug 20967.
> 
> Currently, the debug info support for inlined functions is poor.
> Suppose you have a function A in file A.h inlined into main, and then
> you use gdb or addr2line on an address inside the inlined function.  The
> answer you get will be that you are in the function main in the file
> A.h.  This is correct, but not very useful.
> 
> If gdb and/or addr2line are extended to handle DW_AT_inlined_subroutine,
> then we can do better.  However, there is still one thing we can't
> determine from the current debug info, and that is the line from which
> an inlined function was called.  This can't be computed from surrounding
> info.  We tried, and ran into numerous problems.  Instructions
> scheduling, block reorg, etc may disturb the instruction chain so much
> that this info can't be found.  Also, very short inline functions may
> expand to 0 instructions after optimization, which means that they will
> have no line number info of their own.  There is an easy solution
> though, we just need to emit DW_AT_call_file and DW_AT_call_line info.
> These are part of the original DWARF2 spec, so there should be no
> compatibility problems here.
> 
> With this extra info, we can now generate the same backtraces with
> function inlining as we can generate without function inlining.

How does this affect the size of the debugging information on say, the
tramp3d-v3 testcase?  I would appreciate a way to turn this extra information
off, if possible.

Thanks,
Richard.


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