|
Home > Archive > Red Hat General > January 2004 > GDB problem !?!?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Gemma Haenen 2004-01-23, 7:10 pm |
|
I have a problem with gdb on redhat 9 when I try do debug my
static compiled program: hello.c
I use gcc 3.2.2 for compiling my C program and gdb version
5.3post-0.20021129.18rh.
This is what I see:
-----------------------------------------
$ cat hello.c
#include <stdio.h>
main ()
{
printf ("hello world\n");
}
$ gcc -static -g hello.c
$ gdb a.out
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 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-gnu"...
(gdb) b main
Breakpoint 1 at 0x8048210: file hello.c, line 5.
(gdb) r
Starting program: a.out
Breakpoint 1, main () at hello.c:5
5 printf ("hello world\n");
(gdb) call printf("HELLO")
Breakpoint 1, main () at hello.c:5
5 printf ("hello world\n");
The program being debugged stopped while in a function called from GDB.
When the function (malloc) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
(gdb)
-------------------------------------------
Does this sound familiar to anyone ???
Or am I the only one with this problem ?
Gemma
| |
| J.O. Aho 2004-01-23, 7:10 pm |
| Gemma Haenen wrote:quote:
> I have a problem with gdb on redhat 9 when I try do debug my
> static compiled program: hello.c
> I use gcc 3.2.2 for compiling my C program and gdb version
> 5.3post-0.20021129.18rh.
quote:
> (gdb) b main
> Breakpoint 1 at 0x8048210: file hello.c, line 5.
> (gdb) r
> Starting program: a.out
>
> Breakpoint 1, main () at hello.c:5
> 5 printf ("hello world\n");
quote:
> Does this sound familiar to anyone ???
> Or am I the only one with this problem ?
It seems like your include fiules may have been messed up
I have GCC 3.2.3 and it compiles your program well and there isn't any
problems at all with it.
$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux
2.4.1, statically linked, not stripped
I have used: gcc -static -o hello -g hello.c
I would suggest you reinstall gcc and all the gcc libs.
//Aho
|
|
|
|
|