To fix your file:
Save the changes to your source.
Sun WorkShop automatically saves your changes if you forget this step.
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. fix 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.
fix 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 need to rebuild your program to merge the changes into the executable. When you quit debugging, a message reminds you to rebuild your program.
You can continue executing using continue.
Before resuming program execution, you should be aware of the following conditions:
If you made changes in a function that has already executed, the changes have no effect until:
You run the program again
That function is called the next time
If your modifications involve more than simple changes to variables, use fix then run. Using run is faster because it does not relink the program.
If you made changes in a function not yet called, the changes will be in effect when that function is called.
If you made changes to the function currently being executed, fix's impact depends on where the change is relative to the stopped in function:
If the change is in already executed code, the code is not re-executed. Execute the code by popping the current function off the stack and continuing from where the changed function is called. You need to know your code well enough to figure out whether the function has side effects that can't be undone (for example, opening a file).
If the change is in code yet to be executed, the new code is run.
If you made changes to a function presently on the stack, but not the stopped in function, the changed code will not be used for the present call of that function. When the stopped in function returns, the old versions of the function on the stack execute.
There are several ways to solve this problem:
pop the stack until all changed functions are removed from the stack. You need to know your code to be sure that there are no ill effects.
Use the cont at linenum command to continue from another line.
Manually repair data structures (use the assign command) before continuing.
Rerun the program using start.
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.