Debugging and C++ standard libraries (was: Debugging C++ program in GDB on linux)

Debugging and C++ standard libraries (was: Debugging C++ program in GDB on linux)

Post by Bernd Stri » Tue, 24 Jan 2006 23:18:20


Hello,




While others found this off-topic, I think there are at least three
problems here connected to debugging which can be faced on all usual
C++ implementations. The subject line was clearly off-topic.

Could it be that your standard library is missing debugging information?
Then showing information about its internals will surely fail with all
C++ implementations. The incomplete type is a clear indication that
debugging information is missing.

I'm not sure, whether non-open-source implementors of a standard C++
library have the freedom to make their internals visible enough to make
some debugging sensible at all, i.e. handing out information the full
source code could be derived from easily. I would not expect
source-level debugging to be possible with all C++ implementations.
Even g++ has not enabled this by default. The runtime libraries might
have to be recompiled to make this possible.

Calling methods from a de *** might not be possible when methods are
inlined due to optimization. Maybe you can force the compiler to emit a
non-inlined version of the functions by taking their addresses. The
small missing method which is used in the code is a clear indication of
inlining.

Bernd Strieder
 
 
 

Debugging and C++ standard libraries (was: Debugging C++ program in GDB on linux)

Post by Martin Eis » Wed, 25 Jan 2006 21:13:41


With GCC, using -fkeep-inline-functions might be preferable to
putting contrived lines in the code to do that.


Martin

--
Quidquid latine scriptum sit, altum viditur.