This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/1970: gdb can't find files #included source files after cd (linux, gcc3.3/3.4)
- From: vince dot delvecchio at analog dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 14 Jul 2005 19:04:59 -0000
- Subject: gdb/1970: gdb can't find files #included source files after cd (linux, gcc3.3/3.4)
- Reply-to: vince dot delvecchio at analog dot com
>Number: 1970
>Category: gdb
>Synopsis: gdb can't find files #included source files after cd (linux, gcc3.3/3.4)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 14 19:08:00 UTC 2005
>Closed-Date:
>Last-Modified:
>Originator: vince.delvecchio@analog.com
>Release: GNU gdb 6.3
>Organization:
>Environment:
Linux Fedora Core 3, gcc 3.4.3 (Fedora native) or 3.3.4
gdb 6.3, also 6.1post-1.20040607.43rh and 6.3.50.20050714
>Description:
When part of the source is in an file that was #included with a relative path, gdb can't seem to find the source for the include file if the current directory changes.
>How-To-Repeat:
(echo '#include "foo.h"'; echo 'main(){foo();}') > foo.c
mkdir inc
echo 'int foo(){return 0;}' > inc/foo.h
gcc -g -Iinc foo.c -o foo
mkdir tst
cd tst
gdb ../foo
b main
r
s
gdb prints:
Breakpoint 1, main () at foo.c:2
2 main(){foo();}
(gdb) s
foo () at foo.h:1
1 foo.h: No such file or directory.
in foo.h
If you then "cd .." within gdb, it finds it; cd somewhere else and it loses it again.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: