Content-type: text/html Manpage of panicTrap

panicTrap

Section: (n)
Updated: 1.0
Index Return to Main Contents
 

NAME

panicTrap - Trap panics from Tcl library and enhance diagnostic output  

SYNOPSIS

package require panicTrap

panicTrap

Panic

panicTrapThese VarName

 

DESCRIPTION

This is a Tcl extension designed to provide more information about panics from the Tcl "C" library.

When installed (by package require panicTrap) a call is made to replace the Tcl panic code with a routine in this package. When a panic occures this code attempts to produce a diagnostic output to stdout. followed by an abort. (If the Tcl library is sufficiently lost/broken these efforts may fail.)

panicTrap

Outputs the information as if a panic occured at the place invoked. Use this to verify the setup with out causing a real panic/abort.

Panic

Calls panic at the current location. For testing or, possibly, a real panic is desired. Produces the same output as panicTrap (tailored to the current state) followed by an abort.

panicTrapThese VarName

VarName should be the name of a list of VarNames. When a panic occures the value of each VarName in VarNames will be added to the panic information sent to stdout. Neither VarName nor the list it references need to be defined when panicTrapThese is invoked. The list it refers to may be altered as the program progress to cause any panic to dump different and/or additional information. The list of VarNames may be as long as desired/needed.

 

EXAMPLE

Assume that your main code's directory has a sub-directory named packages and it in turn has a subdirectory containing the panicTrap pkgIndex.tcl and the panicTrap library. The following code can be in the first few lines of your programs script.

# Load the 'panic trap' code right now..
lappend ::auto_path [file dir [file norm [info script]]]/packages
package require panicTrap
 

EXAMPLE

Here, in addition, we ask for the contents of variables varName1 and varName2 to be included.

# Load the 'panic trap' code right now..
lappend ::auto_path [file dir [file norm [info script]]]/packages
package require panicTrap

panicTrapThese foo
set foo [list varName1 varName2]

 

AUTHOR

Tom Turkey <Tom@gandk.site>  

COPYRIGHT

Copyright (C) 2023 Tom Turkey

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.


 

Index

NAME
SYNOPSIS
DESCRIPTION
EXAMPLE
EXAMPLE
AUTHOR
COPYRIGHT

This document was created by man2html, using the manual pages.
Time: 21:11:51 GMT, October 25, 2023