From: Brendan Miller <catphive@catphive.net>
To: gdb@sourceware.org
Subject: Fwd: Fwd: how to determine location of source?
Date: Tue, 03 Mar 2009 03:27:00 -0000 [thread overview]
Message-ID: <ef38762f0903021927x51efb52dy637c04f20ec7ce93@mail.gmail.com> (raw)
In-Reply-To: <ef38762f0903021927oe1429aakef0d6971ef9be5@mail.gmail.com>
Er, sorry, I keep forgetting to hit reply to all.
---------- Forwarded message ----------
From: Brendan Miller <catphive@catphive.net>
Date: Mon, Mar 2, 2009 at 7:27 PM
Subject: Re: Fwd: how to determine location of source?
To: Joel Brobecker <brobecker@adacore.com>
On Mon, Mar 2, 2009 at 6:38 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> Hmm... info sources and maintenance print psymbols PSYMS gives me
>> relative, not absolute paths. Maybe that's all that's encoded into my
>> binaries
>
> Yes and no. I will assume that you are building on a target that
> runs ELF binaries and that your debugging info is DWARF, but the
> principles are the same regardless.
>
> Usually, what the compiler provides a debugging information is
> one attribute that tells you the name of the directory from which
> the compilation was done. Check out the DW_AT_comp_dir attribute,
> and then one attribute that gives you the name of the source file
> as it was given to GCC.
>
> /my/sources% gcc -c -g subdir/foo.c
>
> Will result in:
> DW_AT_comp_dir = /my/sources
> DW_AT_name = subdir/foo.c
Ah, excellent, I was able to get at that information with readelf -w
Brendan
prev parent reply other threads:[~2009-03-03 3:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 0:57 Brendan Miller
2009-03-03 1:05 ` Joel Brobecker
[not found] ` <ef38762f0903021735v54143dd4ga38ed350616357a2@mail.gmail.com>
2009-03-03 1:39 ` Fwd: " Brendan Miller
2009-03-03 1:52 ` Joel Brobecker
2009-03-03 2:22 ` Brendan Miller
2009-03-03 2:39 ` Joel Brobecker
[not found] ` <ef38762f0903021927oe1429aakef0d6971ef9be5@mail.gmail.com>
2009-03-03 3:27 ` Brendan Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ef38762f0903021927x51efb52dy637c04f20ec7ce93@mail.gmail.com \
--to=catphive@catphive.net \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox