Date: Sun, 11 Jan 1998 14:41:39 +0200 (IST) From: Eli Zaretskii To: Peter Palotas cc: djgpp AT delorie DOT com Subject: Re: Call traceback. In-Reply-To: <3.0.16.19980109194307.2a77d7ce@hem1.passagen.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Fri, 9 Jan 1998, Peter Palotas wrote: > I was wondering if it is somehow possible to get a call traceback, during > the execution of a program, i.e. *without* terminating the program or > causing a GPF! (Perhaps even the function names, although this would > probably be kind of hard I suppose). You need to call setjmp with the address of the exception structure and then call the equivalent of `do_faulting_finish_message' function from the library sources, but with the call to `exit' removed. An untested fragment follows: #include #include jmp_buf fake_exception; __djgpp_exception_state_ptr = &fake_exception; if (setjmp(__djgpp_exception_state) { /* Error action. You shouldn't get here, ever. */ } else print_traceback(); `print_traceback' should have the code in `do_faulting_finish_message' (defined on src/libc/go32/dpmiexcp.c which is in djlsr201.zip) that walks the stack frames. To have the function names printed also, you will need to add to `print_traceback' the necessary code from `symify' (also in djlsr201.zip).