This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++, gdb and darwin
- From: Jack Howarth <howarth at bromo dot msbb dot uc dot edu>
- To: "Peter O'Gorman" <peter at pogma dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 3 Oct 2008 22:25:03 -0400
- Subject: Re: libstdc++, gdb and darwin
- References: <20080805134651.GA19155@bromo.msbb.uc.edu> <48988051.1020002@pogma.com> <20081003231555.GA8976@bromo.msbb.uc.edu> <48E6C704.2080109@pogma.com>
On Fri, Oct 03, 2008 at 08:29:40PM -0500, Peter O'Gorman wrote:
> Jack Howarth wrote:
> > On Tue, Aug 05, 2008 at 11:31:13AM -0500, Peter O'Gorman wrote:
> >> Jack Howarth wrote:
> >>> Does anyone know why gdb appears to be unable to find the debug information
> >>> for libstdc++ in gcc 4.3 and gcc trunk on darwin9? This has been reported before
> >>> as...
> >>>
> >>> https://trac.macports.org/ticket/16102
> >>>
> >>> Under current gcc trunk, using Apple's current Xcode 3.1's gdb reports the
> >>> errors of the form...
> >>>
> >>> warning: Could not find object file
> >>> "/sw/src/fink.build/gcc44-4.3.999-20080803/darwin_objdir/i686-apple-darwin9/libstdc++-v3/src/.libs/libstdc++.lax/libmath.a/signbit.o"
> >>> - no debug information available for
> >>> "../../../../gcc-4.4-20080803/libstdc++-v3/libmath/signbit.c".
> >>>
> >>> when I try to run a binary linked to libstdc++ in gdb. My gcc build directory doesn't
> >>> have a libstdc++.lax directory left in it. Is this a flaw in the .la files for gcc?
> >>> Thanks in advance for any advice. I am trying to puzzle out if this is a gcc bug or
> >>> a gdb bug so that I can file a radar report against gdb if it is the later.
> >>> Jack
> >>>
> >> The debug information is stored in the object files. Libtool uses a
> >> convenience library, and, because darwin's linked does not have the
> >> equivalent of --whole-archive --no-whole-archive to ensure that all
> >> members of specific archives are loaded, it unpacks the archive and adds
> >> all the objects. Having created the output, it then deletes these
> >> objects, leaving the debugger with no object files.
> >>
> >> This is "fixed" in recent GNU libtool by calling dsymutil on the newly
> >> created shared library. I have not checked if gcc's version of libtool
> >> has this change. I'll check when I have time and submit a patch if that
> >> is not the case.
>
>
> > Peter,
> > I am still seeing this problem with the current gcc trunk after the
> > libtool update. Are we still messing some additional changes for darwin
> > to eliminate these problems with Apple's gdb not properly finding the
> > object files for libstdc++?
> > Jack
>
> Hi Jack,
>
> How are you starting GDB? Is your build tree still around with all the
> object files in it?
>
> Peter
> --
> Peter O'Gorman
> http://pogma.com
Peter,
If I compile a short c++ program like...
#include <iostream>
using namespace std;
main()
{
cout << "Hello World!" << endl; cout << "Welcome to C++ Programming" << endl; }
with the g++ compiler from gcc trunk and execute...
gdb a.out
...using the Xcode 3.1.1 gdb under MacOS X 10.5.5 on Macintel, I get...
warning: Could not find object file "/sw/src/fink.build/gcc44-4.3.999-20081001/darwin_objdir/i686-apple-darwin9/libstdc++-v3/src/.libs/libstdc++.lax/libmath.a/signbit.o" - no debug information available for "../../../../gcc-4.4-20081001/libstdc++-v3/libmath/signbit.c".
..etc. The build directory from my fink packaging is still remaining but I get...
ls -l /sw/src/fink.build/gcc44-4.3.999-20081001/darwin_objdir/i686-apple-darwin9/libstdc++-v3/src/.libs/libstdc++.lax/libmath.a/signbit.o
ls: /sw/src/fink.build/gcc44-4.3.999-20081001/darwin_objdir/i686-apple-darwin9/libstdc++-v3/src/.libs/libstdc++.lax/libmath.a/signbit.o: No such file or directory
The /sw/src/fink.build/gcc44-4.3.999-20081001/darwin_objdir/i686-apple-darwin9/libstdc++-v3/src/.libs/ directory exists but it
doesn't contain a libstdc++.lax subdirectory.
Jack