RFC --enable-debugging

Benjamin Kosnik bkoz@redhat.com
Wed Nov 6 15:54:00 GMT 2002


>I'm struggling to find good terminology for "library that is
>debuggable" and "library with debugging symbols", because, as Gaby
>pointed out, those are often two different things, and this is the
>distinction we're trying to capture here.  

Perhaps the terminology should just be "library explicitly for use when
debugging."

I have found it easier to debug with -O0 -g. Dealing with gdb and
optimized C++ code is tedious, IMHO, and not very helpful.

>I think using this to allow user-level debug library linking is a good
>idea.  By asking for "debug libraries" (and not just "libraries with
>debug symbols"), a user is asking for a sub-optimal build for the
>purposes of tracking down a problem, so pulling in any found
>user-level debug libraries is probably okay.

Conceptually agreed, as long as the way in which the debug libraries is
found is deterministic.

>However, I think the ultimate extension of this idea would be
>something like: 
>
>  g++ --debug-libraries=c,stdc++,foo -o widget widget.o -lfoo -lbar
>
>This would allow a user to specify for which libraries debugging
>versions should be considered.  Here, libfoo, libc, and libstdc++
>would have debugging versions used, while a non-debugging version of
>libbar would be linked in.

Hmm. This is getting more and more interesting. How would this translate
to the debug libc on linux though? These sources are not in gcc proper.

What would this mean for -lbar as above? Since g++ will not know
anything about libbar, where would it look for the debug version of
libbar? 

This could potentially be a much easier and cleaner way to specify debug
libraries than currently exists.

-benjamin



More information about the Libstdc++ mailing list