public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* control debug information source path
@ 2011-12-28 19:17 nixahn
  2011-12-31  2:05 ` Juan Ramírez
  0 siblings, 1 reply; 2+ messages in thread
From: nixahn @ 2011-12-28 19:17 UTC (permalink / raw)
  To: gcc-help


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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: control debug information source path
  2011-12-28 19:17 control debug information source path nixahn
@ 2011-12-31  2:05 ` Juan Ramírez
  0 siblings, 0 replies; 2+ messages in thread
From: Juan Ramírez @ 2011-12-31  2:05 UTC (permalink / raw)
  To: nixahn; +Cc: gcc-help

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@gmail.com> 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.
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-30 19:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-28 19:17 control debug information source path nixahn
2011-12-31  2:05 ` Juan Ramírez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).