You do not need to make changes to the source code to debug the program. However, you can do the following to make debugging easier:
If the source code has functions that can be called to output data structures, you can call them from the debugger; you may want to create such functions.
It is a good idea to make the following items part of your source code:
An initial stall point if you cannot stop the process easily from within the debugger.
Assertions sprinkled liberally through the sources to help locate errors early.