LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-30-2003, 11:11 AM   #1
ravichella
LQ Newbie
 
Registered: Oct 2003
Location: India
Distribution: mostly RedHat
Posts: 5

Rep: Reputation: 0
Tracing and debugging


If I want to trace my C program line by line while execution and identify the errors if any, how can I do? Any command lione utility or X-server utility that is available that I can make use of?
 
Old 10-30-2003, 11:16 AM   #2
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
use gdb
 
Old 10-30-2003, 11:40 AM   #3
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
When you compile your code:

cc -g myfile.c -o myfile

gdb myfile
>br main
>run
>step for each line of code

> help gives you help inside gdb
 
Old 10-30-2003, 12:45 PM   #4
ravichella
LQ Newbie
 
Registered: Oct 2003
Location: India
Distribution: mostly RedHat
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you. So, I will start learning the gdb utility.
 
Old 10-30-2003, 03:33 PM   #5
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
There are also e few GUI interfaces to gdb: ddd, xgdb.
They're probably included in you distro.
I prefer running gdb in emacs. It has the normal command interface of gdb, but at least you see the sources in an editor as you step through it.
 
  


Reply



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
Visual Debugging and Linux Kernel Debugging Igor007 Programming 0 09-30-2005 10:33 AM
Tracing Spoofed IP Address socceroos Linux - Security 9 08-08-2005 01:45 PM
Tracing traffic origins zoubidoo Linux - Networking 3 05-06-2005 08:28 AM
Tracing which user logs onto which PC kenji1903 Linux - Networking 13 09-13-2004 10:04 AM
tracing ips endezeichen Linux - Networking 6 11-27-2003 07:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:51 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
Open Source Consulting | Domain Registration