Bug 52477 - gdb no line information even though gcc -ggdb
Summary: gdb no line information even though gcc -ggdb
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gdb
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-24 03:36 UTC by Joshua J. Drake
Modified: 2007-04-18 16:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-08-24 19:07:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua J. Drake 2001-08-24 03:36:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.2) Gecko/20010809

Description of problem:
gdb reports that there is no line number information for a program being
debugged when it was compiled with -ggdb

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.create program.c source code
2.run gdb ./program
3.add breakpoint for main
4.run program within gdb
5.type "next"
	

Actual Results:  (gdb) next
Single stepping until exit from function main, 
which has no line number information.


Expected Results:  (gdb) next
printf("Hello world\n");


Additional info:

Comment 1 Trond Eivind Glomsrxd 2001-08-24 15:26:42 UTC
Works just fine here...

[teg@halden teg]$ rpm -q gdb gcc
gdb-5.0rh-15
gcc-2.96-97
[teg@halden teg]$ 

[teg@halden teg]$ cat hello.c
#include <stdio.h>

int main(int argc,char **argv){
        printf("hello, world!\n");
        return 0;
}
[teg@halden teg]$ gcc hello.c -o hello -g
[teg@halden teg]$ gdb hello
GNU gdb Red Hat Linux 7.x (5.0rh-15) (MI_OUT)
Copyright 2001 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 "i386-redhat-linux"...
(gdb) l
1       #include <stdio.h>
2
3       int main(int argc,char **argv){
4               printf("hello, world!\n");
5               return 0;
6       }
(gdb) [teg@halden teg]$ gcc hello.c -o hello -ggdb
[teg@halden teg]$ gdb hello
GNU gdb Red Hat Linux 7.x (5.0rh-15) (MI_OUT)
Copyright 2001 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 "i386-redhat-linux"...
(gdb) l
1       #include <stdio.h>
2
3       int main(int argc,char **argv){
4               printf("hello, world!\n");
5               return 0;
6       }
(gdb)




Comment 2 Joshua J. Drake 2001-08-24 19:04:14 UTC
whether or not the list command works is irrelevant.  this command requires the
source code to be available.  the problem is line number information in the
binary and not file name information.

it did work with -g but -ggdb does not work.  this may be a bug in gcc or gdb.


Comment 3 Joshua J. Drake 2001-08-24 19:07:48 UTC
addtitionally gcc-2.96-97 is not even on the rawhide site!

Comment 4 Trond Eivind Glomsrxd 2001-11-29 00:01:28 UTC
It is, and you should use "-g", not "-gdb". The compiler was available shortly
after from Rawhide, but didn't have anything to do with the report.


Note You need to log in before you can comment on or make changes to this bug.