From owner-freebsd-questions Tue Feb 20 9:18:12 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id 9AD2C37B4EC for ; Tue, 20 Feb 2001 09:18:07 -0800 (PST) (envelope-from lucas@slb.to) Received: (qmail 18001 invoked by uid 1000); 20 Feb 2001 17:18:27 -0000 Date: Tue, 20 Feb 2001 11:18:27 -0600 From: Lucas Bergman To: hanbauder@netscape.net Cc: questions@freebsd.org Subject: Re: Debug with gdb Message-ID: <20010220111827.C10244@billygoat.slb.to> Reply-To: lucas@slb.to References: <085EA454.5B26D9AE.02FF9DBE@netscape.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <085EA454.5B26D9AE.02FF9DBE@netscape.net>; from hanbauder@netscape.net on Mon, Feb 19, 2001 at 08:50:52PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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 extern int bar(void); int main() { bar(); return 0; } wiggum % cat bar.c #include 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