LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-17-2009, 10:11 AM   #1
hjc
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Rep: Reputation: 0
No symbol table is loaded. Use the "file" command. when setting breakpoints


Hi,
I wanted to debug a program. I am really having trouble setting up a breakpoint at a specific line.
The file is named prog2.c and I have compiled using gcc option.
i have attached a snapshot if somebody can figure out why i am getting the No symbol is loaded. can somebody help me? Please let me know the correct syntax for the break option at a particular line numbers

(gdb) gdb prog2
(gdb) break main
Breakpoint 1 at 0x8048432
(gdb) break prog2.c:10
No symbol table is loaded. Use the "file" command.
(gdb) file prog2.c
"/home2/hjc/prog2.c": not in executable format: File format not recognized
(gdb) file prog2
Reading symbols from /home2/hjc/prog2...(no debugging symbols found)...done.
(gdb) break prog2.c:10
No symbol table is loaded. Use the "file" command.
 
Old 10-17-2009, 08:32 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Include "-g" to add the extra information the debugger needs in order to set breakpoints. For example:
Quote:
gcc -g prog2.c -o prog2
'Hope that helps .. PSM
 
1 members found this post helpful.
Old 10-18-2009, 10:52 AM   #3
hjc
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Thank u so much!! it sure did help...i checked under the option_name list. could not find any info on -g. what does the -g option stand for? thanks once again...i was tired of writing printf statements in the programs!!

Quote:
Originally Posted by paulsm4 View Post
Include "-g" to add the extra information the debugger needs in order to set breakpoints. For example:

'Hope that helps .. PSM
 
Old 02-02-2016, 04:03 AM   #4
digche
LQ Newbie
 
Registered: Dec 2012
Location: India
Posts: 5

Rep: Reputation: Disabled
Hi I am getting the same problem, I can not add -g at the time of compilation because It is a very big code which has a make file to compile.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 04:27 AM
"No symbol table is loaded." when ddd is remote debugging with gdbserver powah Linux - Software 1 01-18-2008 10:54 AM
"symbol __pthread_initialize, version GLIBC_2.0 not defined in file libpthread.so.0" citrus Linux - Software 6 01-06-2007 12:24 AM
executing a loaded module returns "command not found" error neelay1 Linux - Software 1 05-08-2006 03:25 PM
avgscan "relocation error" "undefined symbol: __dynamic_cast_2" Monster_user Linux - Software 0 02-22-2006 12:57 PM


All times are GMT -5. The time now is 12:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration