In addition to the "after-the-fact" information provided by
the condition handler, you can debug SDA extensions using the
OpenVMS Debugger. A second copy of the SDA image, SDA_DEBUG.EXE,
is provided in SYS$SYSTEM. By defining the logical name SDA to
reference this image, you can debug SDA extensions as follows:
o Compile your extension /DEBUG/NOOPT and link it /DEBUG or
/DSF.
o Define logical names for SDA and the extension, and invoke
SDA.
o Type SET BREAK START_EXTENSION at the initial DBG> prompt, and
then type GO.
o Invoke the extension at the SDA> prompt.
o When Debug prompts again, use Debug commands to set
breakpoints, and so on, in the extension and then type GO.
o Invoke the extension, providing the necessary arguments.
An example of the preceding steps is as follows:
$ cc /debug /noopt mbx$sda + sys$library:sys$lib_c /library
$ link /debug /share -
mbx$sda.obj, -
sys$library:vms$volatile_private_interfaces /library, -
sys$input /option
symbol_vector = (sda$extend=procedure)
symbol_vector = (sda$extend_version=data)
$ !
$ define mbx$sda sys$disk:[]mbx$sda
$ define sda sda_debug
$ analyze /system
...
DBG> set break start_extension
DBG> go
...
SDA> mbx
break at routine START\START_EXTENSION
...
DBG> set image mbx$sda
DBG> set language c
DBG> set break /exception
DBG> go
MBX commands: 'MBX SUMMARY' and 'MBX <address>'
SDA> mbx summary
...
SDA> mbx <address>
...
%DEBUG-I-DYNMODSET, setting module MBX$SDA
%SYSTEM-E-INVARG, invalid argument
...
DBG>