Dumping

### WHDLoad's dumps and logfiles

Mainly for debugging purposes WHDLoad can create various dump and logfiles.

#### Memory dump

A memory dump is the whole memory used by the installed program written to a file. The size of the dump depends on the installed program (it is equal to the value of ws_BaseMemSize in the Slave structure). A memory dump will be created if the DebugKey is pressed or after an error the CoreDump button will be pressed. The name of the memory dump file created is ".whdl_memory". The default location is "PROGDIR:" but can be changed with the CoreDumpPath option. An existing file with the same name will always be overwritten. If the installed program uses additional Fast-Memory, it is saved under the filename ".whdl_expmem".

#### Register dump

The register dump contains the complete status of the CPU (including MMU), the Cia and the Custom chips. Some Cia and Custom registers are not readable, these are only contained in the dump file if Snoop mode was active. The information will be written to an ASCII file with some highlighting done using Escape sequences (using CSI - Control Sequence Introducer, decimal 155). To view, a program which supports Escape sequences is recommended (e.g. More, MuchMore, MultiView, ...). The name of the dump file is ".whdl_register", the default location is "PROGDIR:" but can be changed with the CoreDumpPath option. If a file with the same name already exists, the dump will be appended - otherwise a new file will be created.

#### Complete dump file

The complete dump file is a IFF file containing the informations of all previously listed dump files. It is intended to be used by other applications. The structure of the file is described in a extra include file named `whddump.i`. Currently the applications WHDLoadGCI (graphical coders interface) and SP (save picture) are reading the complete dump file. The name of the complete dump file created is ".whdl_dump". The default location is "PROGDIR:" but can be changed with the CoreDumpPath option. An existing file will always be overwritten.

#### File access log

All disk accesses will be logged if the FileLog option has been activated. This feature will be very useful to analyze the disk operations of the installed program for debugging and optimizing purposes. The following resload function will create an entry in the log file:

- resload_DeleteFile
- resload_DiskLoad
- resload_Examine
- resload_ExNext
- resload_GetFileSize
- resload_GetFileSizeDec
- resload_ListFiles
- resload_LoadFile
- resload_LoadFileDecrunch
- resload_LoadFileOffset
- resload_SaveFile
- resload_SaveFileOffset

Each file access via the functions above creates one line in the log file, the line identifies the called function, a crc of the read/written data, the parameters and the result. WHDLoad will collect the log entries into an internal buffer. The buffer will be flushed on exit or during an access if the buffer is full. The information will be written to an ASCII file, the name of the dump file is ".whdl_filelog", the default location is "PROGDIR:" but can be changed with the CoreDumpPath option.