This is the mail archive of the mailing list for the libstdc++ project.

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

Re: -g by default?

> > it'd be the best if BOTH a debug and an optimized version be generated
> > like the glibc, wouldn't it ?
> Yes, it'd be great. I leave the details to you, as an exercise in 
> Makefile hackery.
> thanks,
> benjamin

I'm confused.  Does this mean that the one compiled with -O[>=1] gets
debugging symbols?

I want to be able to build my program and link it against libstdc++-v3 in such
a way that it runs at _full optimized speed_, but still allows the debugger to
work.  I am aware that -O[>=1] can sometimes make for a confusing debugging
session, even with -g, but as libstdc++-v3 is built now, the debugger won't
work right at all in some instances, like where the program has thrown an
uncaught exception and you try "bt".

The debugger requires debug symbols to be in libstdc++-v3 so that the
underlying functions that implement exception handling (__throw() and
throw_helper()) can be recognized by the debugger.  Otherwise, it gets
confused and can't do a proper backtrace on stack that has an exception throw
in it.

I'm sorry if this message seems a bit stupid, but I wanted to be clear about
what I was asking.
George T. Talbot
<george at moberg dot com>

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