Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2001 20:50:52 -0500
From:      hanbauder@netscape.net
To:        questions@freebsd.org
Subject:   Debug with gdb
Message-ID:  <085EA454.5B26D9AE.02FF9DBE@netscape.net>

next in thread | raw e-mail | index | archive | help
Hello,
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. 
(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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?085EA454.5B26D9AE.02FF9DBE>