From owner-freebsd-questions Wed Feb 28 17: 4:13 2001 Delivered-To: freebsd-questions@freebsd.org Received: from imo-d08.mx.aol.com (imo-d08.mx.aol.com [205.188.157.40]) by hub.freebsd.org (Postfix) with ESMTP id CCEFD37B719 for ; Wed, 28 Feb 2001 17:04:09 -0800 (PST) (envelope-from wanghx916@netscape.net) Received: from wanghx916@netscape.net by imo-d08.mx.aol.com (mail_out_v29.5.) id n.1c.ea13a6 (16215); Wed, 28 Feb 2001 20:04:01 -0500 (EST) Received: from netscape.com (aimmail01.aim.aol.com [205.188.144.193]) by air-in01.mx.aol.com (v77_r1.21) with ESMTP; Wed, 28 Feb 2001 20:04:01 -0500 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 Mime-Version: 1.0 Message-ID: <2440B420.3C1F4EC1.03595011@netscape.net> X-Mailer: Franklin Webmailer 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 > 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 __________________________________________________________________ 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