From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.help Subject: Re: gdb gud won't show source code Date: Fri, 20 Feb 2009 22:02:28 +1300 Message-ID: <18846.29092.554648.512412@kahikatea.snap.net.nz> References: <63b89039-2f44-45a0-875c-de5e54c44617@g1g2000pra.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235120608 24851 80.91.229.12 (20 Feb 2009 09:03:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2009 09:03:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: viona Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 20 10:04:40 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LaRJD-00062j-T9 for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Feb 2009 10:04:36 +0100 Original-Received: from localhost ([127.0.0.1]:51755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaRHt-0008Sy-7C for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Feb 2009 04:03:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaRHI-0008St-Md for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 04:02:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaRHG-0008Se-U3 for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 04:02:36 -0500 Original-Received: from [199.232.76.173] (port=42580 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaRHG-0008Sb-Ln for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 04:02:34 -0500 Original-Received: from viper.snap.net.nz ([202.37.101.23]:51919) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaRHG-0001vM-1x for help-gnu-emacs@gnu.org; Fri, 20 Feb 2009 04:02:34 -0500 Original-Received: from kahikatea.snap.net.nz (unknown [123.255.29.171]) by viper.snap.net.nz (Postfix) with ESMTP id 1AD313DA7E0; Fri, 20 Feb 2009 22:02:32 +1300 (NZDT) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id 649868FC6D; Fri, 20 Feb 2009 22:02:29 +1300 (NZDT) Original-Newsgroups: gnu.emacs.help In-Reply-To: <63b89039-2f44-45a0-875c-de5e54c44617@g1g2000pra.googlegroups.com> X-Mailer: VM 7.19 under Emacs 22.3.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62223 Archived-At: > I've actually did compile with -g. The fact is, that it can't see it > anyway, unless I specify custom output with -o. > I am not sure whether it's supposed behaviour, cause in all tutorials > I've found there are examples with a.out. > Thanks anyway. >From the command line, if you do (replace myprog with the name of your program name): $ gdb myprog GNU gdb... (gdb) list (gdb) info source what does Gdb print? You should get `somthing like': Current source file is myprog.c Compilation directory is /home/nickrob Located in /home/nickrob/myprog.c Contains 267 lines. Source language is c. Compiled with DWARF 2 debugging format. Does not include preprocessor macro info. if you compile with "gcc -g -o myprog myprog.c". -- Nick http://www.inet.net.nz/~nickrob