On Sat, Apr 27, 2013 at 09:09:25PM +0200, Franco Fichtner wrote:
> On Apr 27, 2013, at 7:36 PM, Ted Unangst <[email protected]> wrote:
>
> > On Sat, Apr 27, 2013 at 08:10, Otto Moerbeek wrote:
> >> On Sat, Apr 27, 2013 at 01:08:06AM -0400, Eitan Adler wrote:
> >>
> >>> Adding static to internal function allows the compiler to better
> >>> detect dead code (functions, variables, etc) and makes it easier for
> >>> the compiler to optimize; e.g., since it knows a function will only
> >>> called once it can inline code; or not output a symbol for a certain
> >>> function.
> >>
> >> In general we don't lik this because it makes things harder to debug.
> >> For libraries, yes, but for programs, no.
> >
> > Isn't that rule only for the kernel? ddb can only see global symbols,
> > but gdb should work fine in userland. Certainly I can set breakpoints
> > on static functions, even when compiled without -g.
>
> On backtrace(3) (which is a GNU thing, I know), static functions don't
> show up with their respective names even though they are in the binary.
> That's a tad annoying, but I am not aware of any other limitation. Can
> someone please enlighten me?
Inlined functions are pretyy confusing in gdb.
-Otto