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