1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-02 19:49:11 +00:00

Restore the dump_stack routine, it's really useful for debugging.

This commit is contained in:
david
2013-09-12 08:12:07 +00:00
parent 42ce2bc9cc
commit ecd7a45ec2

View File

@@ -140,6 +140,16 @@ void lua_report(lua_State *L, char *prefix, int panic)
loguser("%s: %s.", prefix, errormsg);
}
void dump_stack(lua_State *L, char* title) {
int i;
logdebug("DUMPING THE STACK title=%s.\n", title);
for (i = 1; i <= lua_gettop(L); ++i) {
fprintf(stderr, "%d %s %s\n", i, luaL_typename(L, i), luaL_tolstring(L, i, 0));
lua_pop(L, 1);
}
logdebug("END OF DUMP.\n\n");
}
static int traceback (lua_State *L)
{
const char *msg;