> Hi, Dilog!
>
> On Mon, Jun 05, 2000 at 01:04:16PM +0300, you wrote the following:
>
> > Does anyone know how to persuade a recalcitrant C or C++ programme to
> > terminate with a civilised stacktrace instead of a laconic "Segment
> > violation"?

OK people... I know it is hard to believe, but it IS possible to do a stack
trace from within the program. I did it inside the Linux kernel itself.
Doing it inside a user program is much easier. And stack trace is just
the beginning. You can do breakpoints, watched, everything.

There is only one big problem, which is finding the symbol table and parse
it. On linux you can make sure you compile with -g , and look at the
/proc/<pid>/exe link to find the executable. If you omit the -g,
you can do stack trace, but cannot see the parameters to the full,
and cannot see local variables in a good format.

If you want to write an API for this for the global good, contact me,
but be warned it is difficult and I have little time to help.



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to