From owner-freebsd-questions Mon Feb 19 17:10:13 2001 Delivered-To: freebsd-questions@freebsd.org Received: from imo-r11.mx.aol.com (imo-r11.mx.aol.com [152.163.225.65]) by hub.freebsd.org (Postfix) with ESMTP id A825637B491 for ; Mon, 19 Feb 2001 17:10:10 -0800 (PST) Received: from hanbauder@netscape.net by imo-r11.mx.aol.com (mail_out_v29.5.) id n.1a.d766bc (16234) for ; Mon, 19 Feb 2001 20:09:53 -0500 (EST) Received: from netscape.com (aimmail02.aim.aol.com [205.188.144.194]) by air-in02.mx.aol.com (v77_r1.21) with ESMTP; Mon, 19 Feb 2001 20:09:53 -0500 Date: Mon, 19 Feb 2001 20:09:18 -0500 From: hanbauder@netscape.net To: questions@freebsd.org Subject: Debug with gdb Mime-Version: 1.0 Message-ID: <24683761.3B542437.02FF9DBE@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 Hello, I have a executable binary "program" which is generated like this: gcc -c program.c -Wall gcc -c program_1.c -Wall gcc -c program_2.c -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. (gdb) I also tried another way: (gdb) exec-file program (gdb) file program.o Reading symbols from program.o ... done. (gdb) break main Breakpoint 1 at 0x9: file program.cpp, line 55 (gdb) run Starting program: /usr/tmp/test/program.o /usr/tmp/test/program.o: Permission denied. Program exited with code 01. You can't do that without a process to debug. (gdb) Would you please tell me what shall I do to debug it correctly? Thank you very much. __________________________________________________________________ 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