Re: I wish exceptions would give you access to the stack trace
0xCDCDCDCD@gmx.at (Martin B.) wrote (abridged):
Now with (b), *if* your exception would contain stack-trace
information, you could log this information and the user could then
send this information to support, which he's gonna call anyway, as
the error message he got didn't make any sense to him.
It sounds like that requirement would be better satisfied by producing a
core dump, and sending that to support. I should think most major
platforms can do this. For example, Windows has its MiniDumpWriteDump()
API.
A core dump can be cross-referenced with symbol information to produce a
stack trace, and can also include values of variables, even the entire
heap. The tools to do this, and the symbol information, do not need to be
on the machine that creates the core dump. This is an approach my
employer uses in all our current apps.
I wouldn't object to standardising an API for creating core dumps without
killing the process. The details of the saved format could be left to the
implementation, so that an implementation could conform by creating an
empty file. That wouldn't be too onerous. It's a rather different
proposition to that of creating a stack trace directly, especially if the
latter was specified in enough detail that the trace can be parsed by
standard code (as it can in Java).
-- Dave Harris, Nottingham, UK.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]