Environment Settings screen shot
Environment Settings Screen

OpenInsight 9.2.1 saw the introduction of a Debugger Intercept facility and this can be used to create a Debugger Dump file.

The debugger_dump procedure is designed to be executed from within a “debugger intercept” procedure which is triggered when the engine hits a debug condition.  The intercept can be setup by simply openning the Database Manager and chosing the Environment Settings option from the ‘Database’ menu.  On that screen the Intercept radio button can be selected (as shown in the graphiv opposite).

The debugger intercept procedure by default is called “Debugger_Replacement” and an example version is supplied with OpenInsight and you can change this to your own procedure if you wish by updating field 54 of your application’s environment record (see the ENVIRON_CONSTANTS insert) or use the dialog above.

Once in the intercept routine you can look at the contents of any variable in the broken program with the debugger_Fetch() function.   An example of how this works can be found the the debugger_dump() procedure, also supplied with OpenInsight.  This simply attempts to write out the local and global variables to a text file.

One thing to remember about working in the debugger intercept routine is that the engine is already in an error state – your code should do the minimum possible to handle the error and then return – doing lots of screen updating, displaying messages and stuff probably isn’t a good idea.   When we use this we normally write the errors out to a log or send an email and then return.

Thanks to Carl Pates (Sprezzatura) for this article.


2 thoughts on “Debugger_Dump

  1. Hi Barry, I am not aware of a published sample SSP which advises of the error and emails and/or logs the error. However, I’ll email you about this sperately as Carl should be able to help you beased on something that we are working on.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s