Debugging a C program using gcc

Asked by munir on 2009-09-06

With a C compiler in windows we can debug
a program using F7.
We can add watches and see value of variables
at each step the program executes.

Is it possible to do such thing in gcc 4.3 compiler in ubuntu?

I compile a file by the command "gcc filename.c -o outputfile"
When there are errors ,in terminal, it shows the line number where the error occurred.
Is there any way to directly go to the place where error occurred in the text file where the code was written?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
2009-09-06
Last reply:
2009-09-09
Siyan Panayotov (xsisqox) said : #1

A powerful debugger is GNU Debuger ( http://en.wikipedia.org/wiki/GDB ).
You may wish to use Nemiver ( http://projects.gnome.org/nemiver ) wich is a graphical debugger, that uses GNU Debuger as a backend.

Steve McInerney (spm) said : #2

Sounds as though you're confusing the actual compiler vs an integrated development environment.

There are a range of IDE's available for working with C, I personally use Eclipse with CDT for C coding.
I suggest searching for 'ide' packages in the 'Development' section and trialling those to find one you prefer.

Can you help with this problem?

Provide an answer of your own, or ask munir for more information if necessary.

To post a message you must log in.