| 418 | |
| 419 | |
| 420 | static int db_debug (lua_State *L) { |
| 421 | for (;;) { |
| 422 | char buffer[250]; |
| 423 | lua_writestringerror("%s", "lua_debug> "); |
| 424 | if (fgets(buffer, sizeof(buffer), stdin) == NULL || |
| 425 | strcmp(buffer, "cont\n") == 0) |
| 426 | return 0; |
| 427 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || |
| 428 | lua_pcall(L, 0, 0, 0)) |
| 429 | lua_writestringerror("%s\n", luaL_tolstring(L, -1, NULL)); |
| 430 | lua_settop(L, 0); /* remove eventual returns */ |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | |
| 435 | static int db_traceback (lua_State *L) { |
nothing calls this directly
no test coverage detected