'printstack' (from ltests.c) made public
That function is useful for debugging the API.
This commit is contained in:
4
ltests.c
4
ltests.c
@@ -822,7 +822,7 @@ static int listlocals (lua_State *L) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void printstack (lua_State *L) {
|
void lua_printstack (lua_State *L) {
|
||||||
int i;
|
int i;
|
||||||
int n = lua_gettop(L);
|
int n = lua_gettop(L);
|
||||||
printf("stack: >>\n");
|
printf("stack: >>\n");
|
||||||
@@ -1652,7 +1652,7 @@ static int runC (lua_State *L, lua_State *L1, const char *pc) {
|
|||||||
printf("%s\n", luaL_tolstring(L1, n, NULL));
|
printf("%s\n", luaL_tolstring(L1, n, NULL));
|
||||||
lua_pop(L1, 1);
|
lua_pop(L1, 1);
|
||||||
}
|
}
|
||||||
else printstack(L1);
|
else lua_printstack(L1);
|
||||||
}
|
}
|
||||||
else if EQ("print") {
|
else if EQ("print") {
|
||||||
const char *msg = getstring;
|
const char *msg = getstring;
|
||||||
|
|||||||
6
ltests.h
6
ltests.h
@@ -64,7 +64,6 @@ LUA_API Memcontrol l_memcontrol;
|
|||||||
extern void *l_Trick;
|
extern void *l_Trick;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Function to traverse and check all memory used by Lua
|
** Function to traverse and check all memory used by Lua
|
||||||
*/
|
*/
|
||||||
@@ -76,6 +75,11 @@ LUAI_FUNC int lua_checkmemory (lua_State *L);
|
|||||||
struct GCObject;
|
struct GCObject;
|
||||||
LUAI_FUNC void lua_printobj (lua_State *L, struct GCObject *o);
|
LUAI_FUNC void lua_printobj (lua_State *L, struct GCObject *o);
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Function to print the stack
|
||||||
|
*/
|
||||||
|
LUAI_FUNC void lua_printstack (lua_State *L);
|
||||||
|
|
||||||
|
|
||||||
/* test for lock/unlock */
|
/* test for lock/unlock */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user