Bug 52477 - gdb no line information even though gcc -ggdb
gdb no line information even though gcc -ggdb
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: gdb (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-23 23:36 EDT by Joshua J. Drake
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-24 15:07:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua J. Drake 2001-08-23 23:36:46 EDT
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 11:26:42 EDT
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 15:04:14 EDT
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 15:07:48 EDT
addtitionally gcc-2.96-97 is not even on the rawhide site!
Comment 4 Trond Eivind Glomsrxd 2001-11-28 19:01:28 EST
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.