how to determine location of source?

Joel Brobecker brobecker@adacore.com
Tue Mar 3 01:05:00 GMT 2009


> According to documentation I read, debug binaries have the location of
> the source embedded in them. How do I extract this location from the
> binary? Can GDB do this?

I haven't need this type of info much, but "info sources" has been
handy sometimes.

> Also, is there an environment variable or config file that can control
> the directories that source is looked for in?

There are several ways of doing this depending of what you are trying
to do. There is the "dir" command. But perhaps you have moved the
sources elsewhere, and want to translate the encoded source locations
into your new location. Have a look at "set substitute-path".
That's as much as remember off the top of my head.

PS: Sounds like you could benefit greatly from reading the GDB
    documentation. Best advice I ever received in my first year
    of Engineering School.

-- 
Joel



More information about the Gdb mailing list