Search

ParaSoft

HOME
PRODUCTS
SUPPORT
ABOUT
WHAT'S NEW
EVENTS


Insure++

Quick facts

Add-on Modules:
   -INUSE
   -TCA

Comparisons

Technical Papers

Support & Manuals

FAQs

Recent Reviews

User Testimonials

Press Releases


Insure tool to debug c++





Insure++ User's Guide - Signals

Part I



Signals

In addition to its other error checks, Insure++ also traps certain signals. It does this by installing handlers when your program starts up. These do not interfere with your program's own use of signals - any code which manipulates signals will simply override the functions installed by Insure++.

Signal handling actions

When a signal is detected, Insure++ does the following

  • Prints an informative error.
  • Logs the signal in the Insure++ report file, if one is being used.
  • Calls the function _Insure_trap_error .
  • Takes the appropriate action for the signal.

If this last step will result in the program terminating, Insure++ attempts to close any open files properly. In particular, the Insure++ report file will be closed. Note that this can only work if the program hasn't crashed the I/O system. If, for example, the program has generated a "bus" or similar error, it might not be possible to close the open files. In the worst of all possible scenarios you will simply generate another (fatal) signal when Insure++ attempts to clean up.

The third step is useful if you are working with a debugger, as described in "Interacting with Debuggers". In this case, you can insert a breakpoint at _Insure_trap_error and have the program stop whenever it is generating one of the trapped signals.

Interrupting long-running jobs

Insure++ installs a handler for the keyboard interrupt command (often CTRL-C, or the delete key). If your program does not override this handler with one of its own, you can abort a long-running program and still get Insure++'s output. If your program has its own handler for this sequence, you can achieve the same effect by adding the following lines to your handler

	#ifdef __INSURE__
	      _Insure_cleanup();
	#endif

Which signals are trapped?

By default, Insure++ traps the following signals

	SIGABRT
	SIGBUS
	SIGEMT
	SIGFPE
	SIGILL
	SIGINT
	SIGIOT
	SIGQUIT
	SIGSEGV
	SIGSYS
	SIGTERM
	SIGTRAP

You can add to or subtract from this list, by adding lines to one of your .psrc files and re-running the program.

Signals are added to the list with commands such as

	insure++.signal_catch SIGSTOP SIGCLD SIGIO

and removed with

	insure++.signal_ignore SIGINT SIGQUIT SIGTERM

You can omit the "SIG" prefix if you wish.


For more information, call (888) 305-0041 or send email to: insure@parasoft.com

< Tracing >Code Insertions ^ Insure++ User's Guide TOC
Tools to debug c++ and java
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft