[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gdb gud won't show source code
From: |
Nick Roberts |
Subject: |
Re: gdb gud won't show source code |
Date: |
Fri, 20 Feb 2009 22:02:28 +1300 |
> 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