## Printer Device Driver

[prev][next][parent][TOC]

### Breakpoints

This section contains symbols that are helpful when setting breakpoints during debugging.

The driver accesses a function from the GenPLib called GplErrSetError that reports errors that have occurred in the driver. By setting a breakpoint at this function, it is possible to identy the calling function that generated the error. To identify the function with the error, display a stack trace when the breakpoint stops at GplErrSetError. The first function name in the list is the function that generated the error.

It is possible for a trap to occur early in the driver before you are able to set a breakpoint. Instead of inserting an INT 3 in the code, you can insert a breakpoint at the location ENDDEBUGLOADSYMMTE. This routine is called after the symbol file is loaded, but before the driver is executed. First, set up a test case to the point just before accessing the driver; and then, set a breakpoint at ENDDEBUGLOADSYMMTE. When the test case invokes the driver, the breakpoint will be encountered immediately after the PostScript driver and symbols are loaded. Now insert breakpoints in the driver. If the driver responds with an error when inserting driver breakpoints, it might be necessary to run GO four or five times before the debugger understands the symbol names. However, if you prefer to use interrupt 3 (INT 3), there is a function in UTLASM.ASM, called Int3, that accesses the interrupt. Because this function is currently commented out, you must "un-comment" the function to access it.