MCPcopy Create free account
hub / github.com/Norbyte/bg3se / GetVariablesInStackFrame

Method GetVariablesInStackFrame

BG3Extender/Lua/Debugger/LuaDebugger.cpp:1157–1174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1155 }
1156
1157 ResultCode ContextDebugger::GetVariablesInStackFrame(lua_State* L, DebuggerGetVariablesRequest const& req)
1158 {
1159 lua_Debug ar;
1160 memset(&ar, 0, sizeof(ar));
1161
1162 if (lua_getstack(L, req.Frame + 1, &ar) == 0) {
1163 req.Response->set_error_message("Nonexistent stack frame");
1164 return ResultCode::EvalFailed;
1165 }
1166
1167 if (!LuaIsUserFunction(L, ar.i_ci)) {
1168 // Locals in C++ frames are unavailable
1169 return ResultCode::Success;
1170 }
1171
1172 StackFrameToEvalResults(L, &ar, req.Frame + 1, req.Response);
1173 return ResultCode::Success;
1174 }
1175
1176 Debugger::Debugger(DebugMessageHandler& messageHandler)
1177 : messageHandler_(messageHandler),

Callers 1

ContextDebuggerGetVarFunction · 0.80

Calls 2

LuaIsUserFunctionFunction · 0.85
StackFrameToEvalResultsFunction · 0.85

Tested by

no test coverage detected