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