From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 730 invoked by alias); 10 Feb 2006 21:40:58 -0000 Received: (qmail 613 invoked from network); 10 Feb 2006 21:40:21 -0000 Received: from unknown (80.67.18.15) by sourceware.org with QMTP; 10 Feb 2006 21:40:21 -0000 Received: (qmail 12610 invoked from network); 10 Feb 2006 21:40:20 -0000 Received: from unknown (HELO d116055.adsl.hansenet.de) (812175@[80.171.116.55]) (envelope-sender ) by smtprelay03.ispgateway.de (qmail-ldap-1.03) with RC4-MD5 encrypted SMTP for ; 10 Feb 2006 21:40:20 -0000 Subject: gdb does not find any source files in a very simple testcase. From: Yasuo Iwakura Reply-To: deus@thewired.net To: gdb@sourceware.org Content-Type: text/plain Date: Fri, 10 Feb 2006 21:40:00 -0000 Message-Id: <1139607618.14928.25.camel@lainsglove> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00093.txt.bz2 Hello everybody, i set up a simple testcase just containing a HelloWorld-program main.cc: #include 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