| 851 | } |
| 852 | |
| 853 | int Debugger::GetStackLevel(bool skipC) const { |
| 854 | if (!currentL) { |
| 855 | return 0; |
| 856 | } |
| 857 | |
| 858 | auto L = currentL; |
| 859 | |
| 860 | int level = 0, i = 0; |
| 861 | lua_Debug ar{}; |
| 862 | while (lua_getstack(L, i, &ar)) { |
| 863 | lua_getinfo(L, "l", &ar); |
| 864 | if (getDebugCurrentLine(&ar) >= 0 || !skipC) |
| 865 | level++; |
| 866 | i++; |
| 867 | } |
| 868 | return level; |
| 869 | } |
| 870 | |
| 871 | void Debugger::AsyncDoString(const std::string &code) { |
| 872 | doStringList.emplace_back(code); |
no test coverage detected