| 299 | |
| 300 | |
| 301 | static int db_debug (lua_State *L) { |
| 302 | for (;;) { |
| 303 | char buffer[250]; |
| 304 | fputs("lua_debug> ", stderr); |
| 305 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || |
| 306 | strcmp(buffer, "cont\n") == 0) |
| 307 | return 0; |
| 308 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || |
| 309 | lua_pcall(L, 0, 0, 0)) { |
| 310 | fputs(lua_tostring(L, -1), stderr); |
| 311 | fputs("\n", stderr); |
| 312 | } |
| 313 | lua_settop(L, 0); /* remove eventual returns */ |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | |
| 318 | #define LEVELS1 12 /* size of the first part of the stack */ |
nothing calls this directly
no test coverage detected