RFC --enable-debugging
Gabriel Dos Reis
gdr@integrable-solutions.net
Wed Nov 6 12:59:00 GMT 2002
Brad Spencer <spencer@infointeractive.com> writes:
| On Sat, Nov 02, 2002 at 02:15:27PM +0100, Gabriel Dos Reis wrote:
| > Let me rephrase my question
| >
| > 1) Is there any automated way to have the compiler pick the debug
| > library when a program is linked with -g?
|
| As an everyday library user, I compile and link everything with -g
| even when I build final release builds with full optimization so that
| the debugging symbols are in the binary in the event of a crash. If
| -g becomes overloaded to also mean "pick a non-optimized library
| implementation", this could be a nasty surprise.
The primary purpose of the debugged version is to enable debugging.
But, why the -O0 restriction? It has been reported to me that
debugging C++ at anything higher than -O0 doesn't work or play nicely
(I have had opposite experience, but presumably on "simple" constructs).
| Perhaps I simply shouldn't be specifying -g on the _link_ line?
Maybe.
| I
| prefer the explicit -L method. BTW, -g is currently not listed in the
| gcc manual as an option that affects linking, AFAICT.
My gripe with -L approach is that you have to remember exactly the
path and that may be rather long or combersome to type. Having to
repeat things the compiler knows about at build time has always been
proven to be error prone.
-- Gaby
More information about the Libstdc++
mailing list