Hello!
Does anyone know how to persuade a recalcitrant C or C++ programme to
terminate with a civilised stacktrace instead of a laconic "Segment
violation"?
The tasks in question are heavily forked or threaded. Dear old printf()
(or cout ) do help a lot, but
we really have crawled out of the
On Mon, 5 Jun 2000, Dilog Mail wrote:
Hello!
Does anyone know how to persuade a recalcitrant C or C++ programme to
terminate with a civilised stacktrace instead of a laconic "Segment
violation"?
C doesn't have enough information for stack traces in the runtime
--
Moshe Zadka [EMAIL
s type "bt" to
get the stack trace.
--
Alex Shnitman| http://www.debian.org
[EMAIL PROTECTED], [EMAIL PROTECTED] +---
http://alexsh.hectic.netUIN 188956PGP key on web page
E1 F2 7B 6C A0 31 80 28 63 B8 02 BA 65 C7 8B B
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
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 prob
uestion (as found by searcihng dejanews...) : catch the signal, and then
invoke gdb (in batch mode) to attach to your process and dump its stack
trace into a file. see gdb's '-batch' and '-x' command line options. note,
however, that invoking gdb from inside a signal handler could fail...
guy
&