| 11816 | |
| 11817 | |
| 11818 | static int db_debug (lua_State *L) { |
| 11819 | for (;;) { |
| 11820 | char buffer[250]; |
| 11821 | fputs("lua_debug> ", stderr); |
| 11822 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || |
| 11823 | strcmp(buffer, "cont\n") == 0) |
| 11824 | return 0; |
| 11825 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || |
| 11826 | lua_pcall(L, 0, 0, 0)) { |
| 11827 | fputs(lua_tostring(L, -1), stderr); |
| 11828 | fputs("\n", stderr); |
| 11829 | } |
| 11830 | lua_settop(L, 0); /* remove eventual returns */ |
| 11831 | } |
| 11832 | } |
| 11833 | |
| 11834 | |
| 11835 | #define LEVELS1 12 /* size of the first part of the stack */ |
nothing calls this directly
no test coverage detected