This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: how to determine location of source?

> 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:
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]