Debugging MVS dumps

You can use the dbx utility to view MVS™ dumps to determine the cause of program failure. Full source–level debug is available for XL C/C++ programs that have been compiled with -g. Machine level debug is also always available.

Commands that attempt to execute or modify the program are not available in dump processing mode. The following subcommands are available:
For example:
dbx -I /u/fred/src -C tsimple.dmp
FDBX0089: dbx for MVS.
FDBX0399: Compiled: Jul  7 2000 10:04:54 GMT as BFP
FDBX0400: OS level: 09.00 02, LE level: 2.9 without CWIs.
FDBX0100: Type 'help' for help.
FDBX0750: Initializing dump tsimple.dmp.  This may take a while...
FDBX0751: BPXGMCDE token=0x241696f0, release=1, level=0
FDBX0752: BPXGMCDE Starting The TSO environment
FDBX0755: BPXGMCDE BPXTIPCS allocating dump directory via BLSCDDIR
FDBX0757: BPXGMCDE BPXTIPCS invoking IPCS
FDBX0760: BPXGMCDE Dump analysis processing ASIDs: 28 of 29
FDBX0762: Using ASID=0x0018
FDBX0763: Using PID=50331657
FDBX0732: interrupt code=0x4, abend code=0x940C4000, abend reason code=0x4, inst
ruction length=0x4
FDBX0099: reading symbolic information ...
FDBX0900: reading symbols for ./tsimple ...

segmentation violation in f3 at line 23 ($t1)
   23      printf("in f3() %d %p %s %d %d\n",bool,cptr,arry8,a,b);
(dbx) l 22
   22      fptr=0; *fptr=1;
(dbx) p fptr
0x0
(dbx)

The FDBX0762 message shows that dbx has found the ASID in the dump that caused the problem and will use that ASID for further processing. The FDBX0763 message shows that dbx has found the PID in the dump that casued the problem and will use that PID for further processing. The FDBX0732 message shows various information about the abend.

Finally dbx shows where the problem that occurred, in this case a segmentation violation and the source line after the problem occurred. Listing the previous line or lines will show the source line that was being processed when the error occured. Commands such as where and print will allow viewing the final state of the program and help to determine what went wrong. In our example, we see that the value of fptr is zero, and storing into location zero caused the segmentation violation.

An example of how to invoke dbx against a dump in an MVS data set:
dbx -I /u/fred/src -C "//'sys1.dump00'"