[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why -g flag?

Gergely Madarasz <gorgo@caesar.elte.hu> writes:

> > > The idea is to build the program with -g -O2, then install it in the
> > > debian/tmp tree and strip it.  That gets you the following advantages:
> > > 
> > >    - The installed binary is stripped and fully optimized.
> > >    - It's easy to get an unstripped binary: just run debian/build,
> > >      no makefile tinkering necessary.
> > >    - The unstripped binary is useful for debugging core files generated
> > >      by the installed binary.
> Debug the -O2 optimized program ? I don't think that it's the best
> debugging method... :)

Why? gcc produces correct debug code for optimized programs. Even -O9
can be debuged fine. Never had a problem with that. Of cause I'm
usually looking for the reason why there is a segfault. Other stuff I
do via printf. :)

May the Source be with you.

Reply to: