0

My friends are keep telling me "Use debugg idiot !"

I found out that for a code over 200 lines is very important.
But i want to debug only a specific piece of code.
And to review the results of a variable while the code is "executing" .

Is this possible ??

Is there anybody that can show me step by step (using snapshots from his computer for example) how to do this ? I searched over the internet but all the turorials didn't work for me cause of my bad english skills.
Iam using wxDev C++ for writing code in C :-)
Thanks in advance...

2
Contributors
3
Replies
28
Views
4 Years
Discussion Span
Last Post by anestistsoukalis
0

Well on a normal linux machine, it comes with a command called gdb (or you may have to install it) but you just compile your code with gcc -g -o <name> <name>.c and then gdb ./<name> you will then be in the gdb console, where you can use list <linenumber> to view the code you compiled along with the linenumbers alongside. Then type break <linenum> and you can make the program pause when it reaches the line, and return the focus to the console. You can then type things like print <varible> and it will tell you what the value of the varible is. Then you can step through the program line by line with next or continue the program from where you used break with continue and to end the debugger, just type quit

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.