I am upper level CS major, and I have no idea how to do debugging. No where in my courses they are teaching/showing debugging, and all my course works goes like this - here is the project, write a program in C that does XYZ, and by the way use GDB debugger.
Currently, I am taking Assembly language course, and instructor requires use of GDB debugger, hell I don't even know how to do debugging in Visual Studio. And all the projects we are going to do very soon, will require us to "hack" executable using GDB.
Any advice on how to get started/learn debugging, would be highly appreciated.
There is no substitue for just doing it:
Write a very simple program.
Open it in a debugger.
Run your program and step through each line.
Use the debugger's commands to inspect your variables and program state.
Write a more complicated program... Repeat...
If you have written projects on your course and not debugging at all, either you are writing loads of unit tests (that's a good thing), or your programs work first time.
The most important shortcuts for debugging in VS2010 (and 2008) are:
Start Debugging F5
Start without Debugging Ctrl + F5
Quit debugging Shift + F5
Step Into F11
Step Over F10
Step Out Shift + F11
Toggle Breakpoint F9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With