Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Brendan Miller <catphive@catphive.net>
Cc: gdb@sourceware.org
Subject: Re: Fwd: how to determine location of source?
Date: Tue, 03 Mar 2009 01:52:00 -0000	[thread overview]
Message-ID: <20090303015239.GO3632@adacore.com> (raw)
In-Reply-To: <ef38762f0903021739i2ca4e368h2004f8a64eb01b72@mail.gmail.com>

> Right, but before I can use that I need to know what the original path
> was so I can do the substitution. My binaries come from a daily build,
> and I can't know what particular path the build machine made them on
> without inspecting the binaries themselves.

If the build was a different machine, the chances are GDB will not
be able to find the sources by default, as the paths in the debugging
info are invalid for your machine.  In that case, if the sources on
your host are inside one or two directories, the "dir" command might
be sufficient and the easiest to use. Plus, it'll always work.

Otherwise, you have several options. There are some tools out there
that allow you to inspect the debugging information.  The one I like
the most is "readelf". The "set substitute-path" should work.

> I did read the gdb documentation here,

As I said to Brendan as a reply to his first (private) reply,
I almost immediately regretted the way I said it. It was a genuine
advice, and yet I made it sounds like a retort.

> scroll down to the Specifying
> Source Directories section:
> http://sourceware.org/gdb/download/onlinedocs/gdb_8.html#SEC51
> 
> which is why I was posting on the list, because the documentation is
> incomplete, or maybe I just missed something.

Yes, perhaps a reference to some of the GDB commands that can be used
to get that piece of info might be useful. The fee for the help you
are getting here is a patch to the GDB documentation. Thank you! :)

So, doesn't "info sources" give you the kind of info you're looking
for. It's a little verbose, but I don't do see anything that's
directly accessible.  Otherwise, you have "maintenance print
psymbols PSYMS" that also gives you something you can use, but
it's printed on a separate file, and contains even more info.
That's all I can think of for now.

-- 
Joel


  reply	other threads:[~2009-03-03  1:52 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 [this message]
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               ` Fwd: " Brendan Miller

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=20090303015239.GO3632@adacore.com \
    --to=brobecker@adacore.com \
    --cc=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