This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: debugging inline functions
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: debugging inline functions
- From: Per Bothner <per at bothner dot com>
- Date: 28 Nov 1999 14:09:29 -0800
- Cc: gcc at gcc dot gnu dot org, gdb at sourceware dot cygnus dot com
- References: <199911271831.KAA21455@adsl-206-170-148-33.dsl.snfc21.pacbell.net> <m2u2m766gs.fsf@magnus.bothner.com> <19991128135119Y.mitchell@codesourcery.com>
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/