Date: Wed, 28 Feb 2001 20:03:21 -0500 From: wanghx916@netscape.net To: questions@freebsd.org Cc: lucas@slb.to Subject: Debug with gdb is OK Message-ID: <2440B420.3C1F4EC1.03595011@netscape.net>
next in thread | raw e-mail | index | archive | help
Dear Sir,
I eventually know what the problem is. I overlook this line at the end of the Makefile
strip program
So I can't find any symbols from the object file when I gdb it. Everything is OK when I delete this line from the Makefile.
Thank you for so much hints from you.
>> I have a executable binary "program" which is generated like this:
>>
>> gcc -c program.c -g -Wall
>> gcc -c program_1.c -g -Wall
>> gcc -c program_2.c -g -Wall
>> gcc program.o program_1.o program_2.o -o program -g -Wall
>>
>> Now I want to debug it with gdb. But the problem is as follow:
>>
>> $ gdb program
>> Copright 1998 Free Software Foundation, Inc.
>> ...
>> This GDB was configured sa "i386-unknown-freebsd"...
>> (no debugging symbols found)...
>> (gdb) break main
>> Function "main" not defined.
>
>I can't duplicate your problem:
>
> wiggum % cat foo.c
> #include <stdio.h>
> extern int bar(void);
>
> int main()
> {
> bar();
> return 0;
> }
> wiggum % cat bar.c
> #include <stdio.h>
>
> int bar()
> {
> return 0;
> }
> wiggum % gcc -c foo.c -g -Wall
> wiggum % gcc -c bar.c -g -Wall
> wiggum % gcc foo.o bar.o -o program -g -Wall
> wiggum % gdb program
> GNU gdb 4.18
> Copyright 1998 Free Software Foundation, Inc.
> [ blah, blah ]
> This GDB was configured as "i386-unknown-freebsd"...
> (gdb) break main
> Breakpoint 1 at 0x80484ee: file foo.c, line 6.
>
>Try to be more specific about what you do to produce this error.
>
>Lucas
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2440B420.3C1F4EC1.03595011>
