WoW:API debugstack

Revision as of 07:06, 6 February 2006 by WoWWiki>Rmgaddy
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

debugstack([start] [, count1] [, count2])

This function returns a string representation of the current calling stack, similar to the output of the normal Lua debug.traceback() call.

The parameter 'start' is the function level to start the stack trace, which defaults to 1 (the function that called debugstack()).
The parameter 'count1' is the number of function calls to show in the first part of the stack trace, which defaults to 12.
The parameter 'count2' is the number of function calls to show in the second part of the stack trace, which defaults to 10.
If there are more than count1+count2 calls in the stack trace, they are separated by "..."

For example, if you had the following call chain:
debugstack(2, 1, 3)
a()
b()
c()
d()
e()
f()
g()
(g calls f calls e, etc.)
The output would show b, ..., e, f, g