Re: Assert question
On Dec 18, 11:59 am, Rolf Magnus <ramag...@t-online.de> wrote:
Joe Hesse wrote:
If I put an assert in a function and the assert kicks in, is there an
easy way to find out who called the function? I know I could use a
debugger but I was hoping there might be some other way.
What's wrong with a debugger? It's the tool that is designed
to do exactly that.
It depends. If assert kicks in under Unix, you get a core dump,
and can use the debugger for a post mortem; that's really what
assert was designed for. Under Windows, *if* the code is
running on a machine with Visual Studios installed, you can
configure the system so that an assertion failure pops you into
the debugger. (For a very liberal interpretation of "pops"; in
my mind, "pops" is something more or less instantaneous, and it
can take several tens of seconds before the debugger is up and
running.) If the code is running on some users machine,
however (the usual case), there really isn't much you can do;
Windows doesn't do core dumps (at least not by default---I've
heard that there are extensions you can get that do).
--
James Kanze