Re: source code location at build time affects ups

Callum Gibson <[email protected]> Thu, 2 Dec 2004 12:10:42 +1100
Newsgroups gmane.comp.debugging.ups.user
Message-ID <[email protected]>
On 02 Dec 00:36, Tom Hughes wrote:
}I think William's problem may be that he's giving the full path on
}the command line - we always compile in the right directory but it
}does still find the source if we run elsewhere.

We have a similar setup - separate compile/run directory from the source
area, done like that for compiling on multiple platforms with a shared
NFS mounted source tree. I also get the same problems as William with
dwarf-2. I can confirm that running the debugger from the source directory
doesn't help in either case.

Here I'm using:
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)

Further info to help when you have a look...

I compiled the following trivial program:

int
main(int ac, char **av) 
{
    int i = 0;

    i++;
    return i;
}   

with "g++ -gstabs+ -o tctc test.cc"
and get no source with "ups tctc", but ok with "ddd tctc".

With -gdwarf-2, it works (with no crash) in ups. Moving the source to
a subdirectory and recompiling still works, even if run from a different
subdirectory (I'm guessing the path to the source is specified as relative
to the binary in this case). Specifying a full path to the source file
causes ups to exit with the following:

DWARF error :  dwarf_attr - no entry (DIE /full/path/name/test.cc <2380><11>)
Fatal error: segmentation fault.
Dumping core ... Segmentation fault (core dumped)

However, ddd/gdb still works.

-g and -ggdb gives same results as dwarf-2.
-gdwarf gives same results as stabs+
All other forms of -g are unsupported on my compiler.

-- 
Callum Gibson          [email protected]          61 438 266 463 (M)
Rates & ICT IT, Deutsche Bank, Australia [/]  61 2 9258 1620 (W)
### The opinions in this message are mine and not Deutsche's ###