I think that if you use relative paths in the compilation line, the debug information will have relative paths. I use varios versions of GCC (from 4.1 to 4.6) and, a least using the full path in the compilation line, the stored debug information has always included full paths. Anyway, you could try -fdebug-prefix-map: -fdebug-prefix-map=$relativedir=$(readlink -f $relativedir) Saludos! Juan On Wed, Dec 28, 2011 at 1:56 AM, nixahn <nixahn@xxxxxxxxx> wrote: > > Hi, this is my first post in this forum; I am having problems with the stored > debugging information; I have 2 different platforms running gcc 4.1 and 4.6 > which behave differently. In one, when I compile a binary using a static > library, the source files for the library are stored with their absolute > paths. this is useful because gdb then finds the source files automatically. > in the 4.1 platform (a rocks cluster with redhat) the source files info is > stored only by name, without paths. I know I could try to add the directory > for the source files with gdb, the problem is that the library is gsl and > the source files are in many subdirectories, making it problematic to > specify all of them to gdb. it would be great if I knew how to control > whether gcc stores absoulute source paths in the debugging information. is > this related to the debug format? when building my binary and gsl, I always > use the -g option, but since both platforms are linux they should be using > stabs according to the little I read. > > Anyhow, I hope someone can point me in the right direction... thanks in > advance > -- > View this message in context: http://old.nabble.com/control-debug-information-source-path-tp33044253p33044253.html > Sent from the gcc - Help mailing list archive at Nabble.com. >