The fix and continue feature lets you modify and recompile a native source file and continue executing without rebuilding the entire program. By updating the .o files and splicing them into your program, you don’t need to relink.
The advantages of using fix and continue are:
You do not have to relink the program.
You do not have to reload the program for debugging.
You can resume running the program from the fix location.
Do not use the fix command if a build is in progress.
Before using the fix command you must edit the source. (See Modifying Source Using Fix and Continue for the ways you can modify your code). After saving changes, type fix. For information on the fix command, see fix Command.
Once you have invoked the fix command, dbx calls the compiler with the appropriate compiler options. The modified files are compiled and shared object (.so) files are created. Semantic tests are done by comparing the old and new files.
The new object file is linked to your running process using the runtime linker. If the function on top of the stack is being fixed, the new stopped in function is the beginning of the same line in the new function. All the breakpoints in the old file are moved to the new file.
You can use fix and continue on files that have been compiled with or without debugging information, but there are some limitations in the functionality of the fix command and the cont command for files originally compiled without debugging information. See the -g option description in fix Command for more information.
The pre-compiled headers feature of the Sun Studio C and C++ compilers requires that the compiler options be the same when recompiling. Because the fix command changes the compiler options slightly, do not use the fix command on object files that were created using precompiled headers.
You can modify source code in the following ways when using fix and continue:
Add, delete, or change lines of code in functions
Add or delete functions
Add or delete global and static variables
Do not change the name of a function.
Do not add, delete, or change the type of arguments to a function.
Do not add, delete, or change the type of local variables in functions currently active on the stack.
Do not make changes to the declaration of a template or to template instances. Only the body of a C++ template function definition can be modified.
If you make any of the above changes, rebuild your entire program rather than using fix and continue.