Re: source code location at build time affects ups

Tom Hughes <[email protected]> Tue, 30 Nov 2004 22:28:52 GMT
Newsgroups gmane.comp.debugging.ups.user
Message-ID <[email protected]>
In message <1101846387.4748.62.camel@wdowlingpc>
          "William F. Dowling" <[email protected]> wrote:

> I have noticed something odd under Linux (but not Solaris), debugging
> code built with g++ 3.2.3. For ups to work, the source code must be in
> the working directory when the executable is built.
> 
> The first example below fails; the second suceeds.
> 
> $ g++ -g -o hello /home/wdowling/src/hello.cpp # non-trivial path to
> source
> $ /links/extern/i686/bin/ups hello
> DWARF error :  dwarf_attr - no entry (DIE /home/wdowling/src/hello.cpp
> <2643><11>)
> Already saved typename rebind<char> in this CU <2632>
> 
> ups starts up, but no source code is visible; if a source path is added
> (on the command line or in the interface) the source is visible, but
> breakpoints cannot be set nor data examined.

I suspect that -g is defaulting to stabs and standard stabs only
provides the leaf name of the source file. Try -gstabs+ to turn on
the gcc extensions and I suspect it will work. Even better would
be to use -gdwarf-2 and say goodbye to the horror that is stabs.

Tom

-- 
Tom Hughes ([email protected])
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/