This is the mail archive of the gcc@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]

Re: debugging inline functions


Mark Mitchell <mark@codesourcery.com> writes:

> I had intended to:
> 
>   o Fix the filename/linenumber issue to that the code for an inlined
>     function would have the file/name corresponding to the location
>     of the inlined function.
> ...
> 
> The back-end won't know that the callee was ever a separate function,
> so I would assume that in GDB you will just see the stack-trace
> indicating you are in the caller, rather than the callee, even though
> the source display will show the callee.
> 
> To me, that makes sense.
> 
> Is that OK with everyone?

Isn't that more-or-less the current behaviour (except for adding the local
variable declarations), which is what I was complaining about?

I think a stack trace displaying the caller's function but with the inlined
callee's line number is quite counter-intuitive and confusing.  I certainly
have found it so in the past.  Still, that is a user-interface issue - i.e.
a gdb issue.  We should make sure the debug output emits enough information
so that the debugger can (in theory) present the call/inline state clearly.
I agree that suggests emiting the inlined callee's line numbers.  But we
should also emit some indication that the function *was* inlined.  Does
dwarf2 have a defined way to do this?  If so, I'd like Gcc to emit it.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


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