This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: trouble locating source files through relative paths
On Wed, 2005-08-24 at 07:24 -0400, Bob Rossi wrote:
> Well, I haven't had enough time to investigate this more, however, I did
> find some odd results with the example I came up with. For example, if
> I do 'info sources' before the dir command is applied, GDB spits out the
> relative path. However, if I do the dir command, and then do 'info
> sources', then GDB spits out the absolute path.
Both before and after I do the 'dir' command 'info sources' spits out
the filename with no path at all.
>
> Once GDB has the absolute path, if I then do 'list uut.h:1', GDB can
> still not find the file. If I do 'list ../include/uut.h:1',
> then I get an Internal GDB error. Do you get these same results?
When I do 'list GeAttribute.H:1' in my application GDB fails to find the
file after trying 'GeAttribute.H' in the directory I specified with
'dir' and my cwd. It also tries
'../../../include/General/GeAttribute.H'. I can't say I know where it
figures out this relative path from because 'info sources' doesn't
mention it, however that path is correct when taken from the location of
the binary (the path I gave to 'dir').
If I try 'list ../../../include/General/GeAttribute.H:1' it says:
'No source file named ../../../include/General/GeAttribute.H.'
The strace during 'list ../../../include/General/GeAttribute.H:1'
indicates that no attempt is made to look for this file. GDB must
determine this by looking at the list of source files gathered from the
binary.
Cheers,
Craig.