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?
|
use gdb
|
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 |
Thank you. So, I will start learning the gdb utility.
|
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. |