Debugging a Program With dbx

save

The save command saves to a file all debugging commands issued from the last run, rerun, or debug command up to the save command. This segment of a debugging session is called a debugging run.

The save command saves more than the list of debugging commands issued. It saves debugging information associated with the state of the program at the start of the run -- breakpoints, display lists, and the like. When you restore a saved run, dbx uses the information in the save-file.

You can save part of a debugging run; that is, the whole run minus a specified number of commands from the last one entered. Example A shows a complete saved run. Example B shows the same run saved, minus the last two steps:

 A.   B. 
   debug     debug
   stop at line     stop at line
    run    run
   next    next
 Saving a Complete Run  next  Saving a Run Minus the Last Two Steps  next
  stop at line   stop at line
  continue   continue
   next    next
   next    next
   step    step
   next     next
    save    save-2

If you are not sure where you want to end the run you are saving, use the history command to see a list of the debugging commands issued since the beginning of the session.

To save all of a debugging run up to the save command:


(dbx) save

To save part of a debugging run


(dbx) save number

where number is the number of commands back from the save command that you do not want saved.