Date: Thu, 24 Sep 1998 15:26:14 +0200 (CEST) Message-Id: <199809241326.PAA10226@login-2.eunet.no> From: "Gisle Vanem" To: djgpp AT delorie DOT com Subject: preserving exception context MIME-Version: 1.0 Content-type: text/plain; charset=cp850 Content-Transfer-Encoding: 8bit Precedence: bulk I have a rather large program that must exit gracefully even after crashing. I've installed a signal-handler for SIGSEGV/SIGFPE which is supposed to exit safely. In the exception handler I have: signal (SIGSEGV,SIG_DFL); /* to prevent nested SIGSEGV's */ shutdown(); /* lot of tidying up here */ raise (SIGABRT); /* traceback, exit */ The problem is that if shutdown() also crashes, I get a traceback for that crash and not the originating fault. How can I (besides writing shutdown() foulproof) get a traceback for both or a least only the first crash. The crash in shutdown() is most certainly a consequence of the first crash so that it's not so (IMHO) important to trace. (i.e. overwritten data etc.) Note, this is all with djgpp 2.02 alpha, where `raise(SIGABRT)' seems to work as intended (I sometimes got stange results in 2.01). Otherwise I use DOS 6.22, QEMM 7.53 and CWSDPMI on a 90MHz Pentium PC. Gisle V.