Save the changes to your source.
Type fix at the dbx prompt.
Although you can do an unlimited number of fixes, if you have done several fixes in a row, consider rebuilding your program. The fix command changes the program image in memory, but not on the disk. As you do more fixes, the memory image gets out of sync with what is on the disk.
The fix command does not make the changes within your executable file, but only changes the .o files and the memory image. Once you have finished debugging a program, you must rebuild your program to merge the changes into the executable. When you quit debugging, a message reminds you to rebuild your program.
If you invoke the fix command with an option other than -a and without a file name argument, only the current modified source file is fixed.
When fix is invoked, the current working directory of the file that was current at the time of compilation is searched before executing the compilation line. There might be problems locating the correct directory due to a change in the file system structure from compilation time to debugging time. To avoid this problem, use the command pathmap, which creates a mapping from one path name to another. Mapping is applied to source paths and object file paths.
You can continue executing using the cont command (see cont Command).
Before resuming program execution, be aware of the following conditions that determine the effect of your changes.
You run the program again
That function is called the next time
If your modifications involve more than simple changes to variables, use the fix command, then the run command. Using the run command is faster because it does not relink the program.
If the change is in code that has already been executed, the code is not re-executed. Execute the code by popping the current function off the stack (see pop Command) and continuing from where the changed function is called. You need to know your code well enough to determine whether the function has side effects that can’t be undone (for example, opening a file).
If the change is in code that is yet to be executed, the new code is run.
If you have made changes to a function presently on the stack, but not to the stopped in function, the changed code is not used for the present call of that function. When the stopped in function returns, the old versions of the function on the stack are executed.
There are several ways to solve this problem:
Manually repair data structures (use the assign command) before continuing.
Rerun the program using the run command.
If there are breakpoints in modified functions on the stack, the breakpoints are moved to the new versions of the functions. If the old versions are executed, the program does not stop in those functions.