C and C++ SoftBench User's Guide
Using SoftBench Debugger
Correcting Errors in Your Program
Chapter 7 207
Correcting Errors in Your Program
Developers frequently spend a lot of time in the debugger, finding and
fixing defects. SoftBench Debugger provides several commands to help
you when you find an error:
• You can alter variable values (see “Specifying Variables” on page 178)
• You can change the location of the PC within the current procedure
(see SoftBench Online Help for details), skipping the problem code
and continuing debugging.
• You can edit the source code, fixing the problem, then rebuild and
restart the debugging process.
Editing Source Code
SoftBench Debugger provides an editable source code area. Without ever
leaving SoftBench Debugger you can fix the error and rebuild.
• Edit the source file by selecting the Edit button to make the source
code area editable. If you need to check the file out of Configuration
Management, do so before making changes. Choose the "File:
Configuration Management" submenu.
• Save the changes and use the "Build" facility to rebuild the target by
choosing "File: Build" from the SoftBench Debugger menu bar. If
the file is not writable, you may need to check it out using the "File:
Configuration Management" submenu.
SoftBench rebuilds the current debugged program. If SoftBench
encounters any compile errors, it displays the offending source in the
Debugger's Source File Area or your configured editor, depending on
the setting of the "Options: ■ Use External Editor for Compile
Errors" toggle button.Any errors afterthe first error are displayed in
your configured editor.
If your edits introduce compile errors, browse and fix the compile
errors from the main SoftBench Builder output browser, then rebuild
again from SoftBench Debugger.
• When your build is successful, the new executable loads
automatically in SoftBench Debugger, and you can continue to debug
the program.