LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Tracing and debugging (https://www.linuxquestions.org/questions/programming-9/tracing-and-debugging-110421/)

ravichella 10-30-2003 11:11 AM

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?

h/w 10-30-2003 11:16 AM

use gdb

jim mcnamara 10-30-2003 11:40 AM

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

ravichella 10-30-2003 12:45 PM

Thank you. So, I will start learning the gdb utility.

Hko 10-30-2003 03:33 PM

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.


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