This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Problems Debugging Shared C++ Libs
- From: Robert Lockwood <rolockwo at cmguc dot com>
- To: <gdb at sources dot redhat dot com>
- Date: Mon, 28 Apr 2003 09:37:17 -0400
- Subject: Problems Debugging Shared C++ Libs
My group has been having a lot of problems debugging programs that are
linked to shared C++ libraries on Solaris 2.8.
The two biggest problems are the inability to consistently "step" and
failure to stop at break points.
I have run Linux side by side with Solaris, and Linux works fine.
Furthermore, I have tried almost all versions of the compiler from
2.95.2 through 3.2.2. I have also tried various versions of gdb from
4.18 through 5.2.1 (having trouble building 5.3) and I have tried
various combinations of the g++/gdb versions.
Given a library (say libfoo), if libfoo is built as an archive then
stepping and breakpoints work fine. Furthermore there are cases where
libfoo built as a shared library works fine. It appears as though is
some sort of threshold and once that threshold is crossed, everything
falls apart. For example, say libfoo contains some number of object
files, and a program links to libfoo everything appears to work fine.
The problem of step and break point failures can be seen by adding more
object files to libfoo (even though there are no references to the
symbols in these new objects from the program being debugged). The
problem may be correlated to the use of templates but I'm not sure.
When compiling we are using "-fPIC -g". When building the shared
library we are using "-shared". Linking executable with "-fPIC -g".
I have also experimented with various -g options, but nothing seems to
fix the problem.
Is anyone else experiencing such problems? Does anyone know of a fix?
Any help appreciated!!!
Thanks,
Bob
Bob