Bug 52477

Summary: gdb no line information even though gcc -ggdb
Product: [Retired] Red Hat Raw Hide Reporter: Joshua J. Drake <jdrake>
Component: gdbAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-24 19:07:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.