Hi,
I am using linux, gcc, c. I have a make file.
I want to debug my module. How can I do it?
I don't want to debug a single file, I want to debug the whole module.
Hi,
I am using linux, gcc, c. I have a make file.
I want to debug my module. How can I do it?
I don't want to debug a single file, I want to debug the whole module.
Compile your code with the -g flag, and then use the gdb debugger. Documentation for gdb is here, but in essence:
gcc -g -o prog myfile.c another.c
and then:
gdb prog
If you want a user-friendly GUI for gdb, take a look at DDD or Insight.
I guess that you are building from the command line.
You might want to consider an IDE (Integrated Development Environment), such as KDevelop or Eclipse, etc (hint - Eclipse ... ECLPISE ... E C L I PS E).
Use an IDE to edit your code, refactor your code, examine your code - class tree, click a variable, class or function to jump to declaration, etc, etc
And - of course - to debug:
p.s as wasatz mentioned- DD is great - for visualizing the contents of arrays/matrices, and - imo - especially if you have linked lists