Date: Thu, 11 Jun 1998 20:35:08 +0300 (IDT) From: Eli Zaretskii To: lubaldo AT adinet DOT com DOT uy cc: djgpp AT delorie DOT com Subject: Re: Forcing Traceback output with debuging purposes of a library. In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 9 Jun 1998 lubaldo AT adinet DOT com DOT uy wrote: > I am adding some debuging capabilities to my PPCol library but I don't > know how to force the output of the traceback, so the user can trace all the > calls to functions and look where happened the problem. From the code you posted I understand that you want to generate the traceback and abort the program. If that's true, use the following little wonder: signal (SIGINT, SIG_DFL); __asm__ __volatile__ ("movb $0x1b,%al;call ___djgpp_hw_exception"); The only thing that's not quite nice about this is that it says "Exiting due to signal SIGSEGV", which is a lie, but other than that it works just fine. > raise(SIGABRT); //Tried with SIGSEGV also but got the same results. SIGABRT is not documented to generate a traceback, so it doesn't. In DJGPP v2.02, it *will* generate a traceback, so the above will work then. In the meantime, use the inline assembly code.