mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Remove a debugging function, stack_dump, that I used to step through NSE code.
Something like it should remain a part of NSE, because it helped me to see what was in the Lua stack inside GDB. I got the function from http://www.lua.org/pil/24.2.3.html.
This commit is contained in:
24
nse_init.cc
24
nse_init.cc
@@ -26,30 +26,6 @@ extern NmapOps o;
|
||||
extern int current_hosts;
|
||||
extern int errfunc;
|
||||
|
||||
void stack_dump(lua_State *L) {
|
||||
int i;
|
||||
int top = lua_gettop(L);
|
||||
for (i = 1; i <= top; i++) {
|
||||
int t = lua_type(L, i);
|
||||
switch (t) {
|
||||
case LUA_TSTRING:
|
||||
printf("\"%s\"", lua_tostring(L, i));
|
||||
break;
|
||||
case LUA_TBOOLEAN:
|
||||
printf("%s", lua_toboolean(L, i) ? "true" : "false");
|
||||
break;
|
||||
case LUA_TNUMBER:
|
||||
printf("%g", lua_tonumber(L, i));
|
||||
break;
|
||||
default:
|
||||
printf("<%s>", lua_typename(L, t));
|
||||
break;
|
||||
}
|
||||
printf(" ");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* int error_function (lua_State *L)
|
||||
*
|
||||
* Arguments:
|
||||
|
||||
Reference in New Issue
Block a user