diff options
| author | ame <[email protected]> | 2024-09-30 02:06:47 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-09-30 02:06:47 -0500 |
| commit | 1cc24fda87c3e8df90a5ea2d526ce39adf4a7648 (patch) | |
| tree | 6409e4b3c43b17e9c73d2b29193450712fb63190 /src/test.c | |
| parent | eda53f915dc319cec7a4fe680734db87a113fe5e (diff) | |
cookies, sendfile fixes, and local var tests
Diffstat (limited to 'src/test.c')
| -rw-r--r-- | src/test.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -23,3 +23,29 @@ int ld_match(lua_State* L){ return 2; } +int l_stack_dump(lua_State* L){ + /*StkId a = L->top.p-2; + printf("%i %i\n", ttype(s2v(a)), LUA_TSTRING); + printf("is string? %i\n", ttisstring(&a->val)); + printf("%s\n", tsvalue(&a->val)->contents);*/ + //int level = 0; + //lua_lock(L); + //for(CallInfo* ci = L->ci; ci != &L->base_ci; ci = ci->previous) level++; + //lua_unlock(L); + //level -= 2; + + //printf("%i\n", level); + lua_Debug info; + for(int i = 0; ; i++){ + if(lua_getstack(L, i, &info) == 0) break; + for(int idx = 1;; idx++){ + const char* name = lua_getlocal(L, &info, idx); + if(name == NULL) break; + printf("l:%i | %s = %s %s\n", i, name, lua_tostring(L, -1), lua_typename(L, lua_type(L, -1))); + lua_pop(L, 1); + } + } + //lua_getstack(L, level, &info); + //const char* name = lua_getlocal(L, &info, 2); + return 0; +} |
