Date: Tue, 20 Feb 2001 11:18:27 -0600 From: Lucas Bergman <lucas@slb.to> To: hanbauder@netscape.net Cc: questions@freebsd.org Subject: Re: Debug with gdb Message-ID: <20010220111827.C10244@billygoat.slb.to> In-Reply-To: <085EA454.5B26D9AE.02FF9DBE@netscape.net>; from hanbauder@netscape.net on Mon, Feb 19, 2001 at 08:50:52PM -0500 References: <085EA454.5B26D9AE.02FF9DBE@netscape.net>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010220111827.C10244>