This is the mail archive of the gdb@sourceware.org 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: trouble locating source files through relative paths


On Thu, Aug 25, 2005 at 10:07:12AM +1000, Craig Jeffree wrote:
> 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.'

Hi Craig,

Thanks for all the explaining. I have yet another question. Does
GeAttribute.H also have a counterpart GeAttribute.cpp? If so, is that
file found by GDB before or after the dir command? I appreciate the
response's because the examples I reproduce are slightly different then
what you are seeing, although it might be enough to prove the point.

Thanks,
Bob Rossi


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