[Issue 1425] Feature Request: call stack reflection
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Sep 5 11:22:12 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=1425
RazvanN <razvan.nitu1305 at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |razvan.nitu1305 at gmail.com
Resolution|--- |FIXED
--- Comment #3 from RazvanN <razvan.nitu1305 at gmail.com> ---
I do not know what the situation was back then with assert, but now, the simple
builtin assert is enough to get a stack trace. It seems like `assert` is a
wrapper which implements the features requested so, in my opinion this should
be closed. Reopen if I misunderstand something.
Example:
void foo(int p1, int p2)
{
assert(p1 == p2);
}
void bar(int p1, int p2)
{
foo(p1, p2);
}
void main()
{
int var5 = 1;
int var6 = 2;
bar(var5, var6);
}
Prints:
core.exception.AssertError at fast.d(23): Assertion failure
----------------
??:? _d_assertp [0x425d65]
??:? void fast.foo(int, int) [0x425c86]
??:? void fast.bar(int, int) [0x425c94]
??:? _Dmain [0x425cb0]
--
More information about the Digitalmars-d-bugs
mailing list