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]

gdb does not find any source files in a very simple testcase.


Hello everybody,

i set up a simple testcase just containing a HelloWorld-program

main.cc:
#include <stdio.h>

int main()
{	printf("Puga!");
}

it resides i a directory called "HelloWorld".
No other files are there, at the moment. 
Then i compile it using:

g++ main.cc (using gcc with a main.c does not work either)

then i start gdb (from the same directory):

yasuo@lainsglove ~/Projects/HelloWorld $ gdb a.out
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".

(gdb) info sources
Source files for which symbols have been read in:



Source files for which symbols will be read in on demand:

/var/tmp/portage/glibc-2.3.6-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crtn.S,
/var/tmp/portage/glibc-2.3.6-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S

Here i expect gcc to list main.cc, but it does not. So i check the
indexed directories: 

(gdb) show directories
source directories searched: $cdir:$cwd

The $cwd contains main.cc, but gdb does not use it. 
I tried to add it manually, but it did not help.

(gdb) list
1       /var/tmp/portage/glibc-2.3.6-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S: Datei oder Verzeichnis nicht gefunden.

in /var/tmp/portage/glibc-2.3.6-r2/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S
(gdb)    

(Sorry for the german locales, "Datei oder Verzeichnis nicht gefunden"
translates to: "File or directory not found").
As you might know /var/temp/portage is the temporary directory of the
gentoo portage system. gdb and glibc got compiled there. 
Everything other than sourcefiles work fine. For example i can set
breakpoints:

(gdb) break main
breakpoint 1 at 0x804845a

And gdb uses them: 

(gdb) run
starting program: /home/yasuo/Projects/HelloWorld/a.out

Breakpoint 1, 0x0804845a in main ()

But i would like to show gdb the sourcelines(in backtraces for example
they are REALLY handy).

Here is some extra information about my system: 

yasuo@lainsglove ~/Projects/HelloWorld $ gcc --version
gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)


sys-libs/glibc
	Latest version available: 2.3.6-r2	
	Latest version installed: 2.3.6-r2

yasuo@lainsglove ~/Projects/HelloWorld $ uname -a
Linux lainsglove 2.6.14-gentoo-r6 #7 PREEMPT Tue Feb 7 11:51:23 
CET 2006 i686 AMD Athlon(tm) XP 2600+ AuthenticAMD GNU/Linux

What am i doing wrong? Is this a bug? 
Or is it a gentoo-related Problem?
 

Thanks i advance
-- 
Yasuo Iwakura <deus@thewired.net>


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