14.3. Debugging

Up: Contents Next: Error Handling Previous: Viewers: Looking at PETSc Objects

PETSc programs may be debugged using one of the two options below.


Note that, in general, debugging MPI programs cannot be done in the usual manner of starting the programming in the debugger (because then it cannot set up the MPI communication and remote processes).

By default the GNU debugger gdb is used when -start_in_debugger or -on_error_attach_debugger is specified. To employ either xxgdb or the common UNIX debugger dbx, one uses command line options as indicated above. On HP-UX machines the debugger xdb should be used instead of dbx; on RS/6000 machines the xldb debugger is supported as well. By default, the debugger will be started in a new xterm (to enable running separate debuggers on each process), unless the option noxterm is used. In order to handle the MPI startup phase, the debugger command ``cont'' should be used to continue execution of the program within the debugger. Rerunning the program through the debugger requires terminating the first job and restarting the processor(s); the usual ``run'' option in the debugger will not correctly handle the MPI startup and should not be used. Not all debuggers work on all machines, so the user may have to experiment to find one that works correctly.


Up: Contents Next: Error Handling Previous: Viewers: Looking at PETSc Objects