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]
Other format: [Raw text]

status on --enable-debug, --debug-libraries=c,c++

Last month, there was a thread on libstdc++ on options to increase
debuggability of linked C++ library code. There is ongoing work in
both g++ and gdb (interested people should seriously look into the -r
carlton_dictionary-branch of the current gdb sources), but there is
also work that needs to be done in libstdc++ to improve debugability.

This thread was called "[RFC] --enable-debug" and can be found
starting here:

A summary of this thread is as follows:

Configure options:

  would build a debug version of libstdc++, in addition
  to the normal (optimized) build done currently

  would specify the (non-default) flags with with to build said debug library

Library name

  same as non-debug library.

  something else

Install location

  (Debian already does this for libstdc++, other linux distros
  including Red Hat do this with glibc and other system libraries)

  something else, if name is different. One possibility would be

Using it

   manually adding -L to compiler. no relinking should be necessary.


   specifying a flag on the compile line that automatically selects
   the correct library, like -static, or -pthread, but
   --debug-libraries=c,stdc++. This involves dealing with
   gcc/cp/g++spec.c's LIBSTDCXX and LIBSTDCXX_PROFILE, adding
   something like LIBSTDCXX_DEBUG.  Sketch by Loren:
   no relinking should be necessary.

I've screwed around this week with an implementation, and didn't get
very far. Of the "or" branches above, I think the second one is more
involved but way, way more slick.

However, I'm having problems just getting a library + debug library built.

Possible implementation scenarios are as follows:

1) use the multilib infrastructure

2) make a separate 'debug' directory in the build tree and use that

3) try to hack something up with using an 'all-local' rule in src/

4) try to do conditional compilation hacks in src/ a la

debug_library =
debug_library =
toolexeclib_LTLIBRARIES = $(debug_library)

(I can't figure out how to have CXXFLAGS or equivalent be different
for libstdc++ and libstdc++_debug)

Right now, I'm leaning towards 1 or 2. Am I missing an approach that
would be easier? Does this sound like something that would generally
be useful?


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