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

Method GetVariablesInContext

BG3Extender/Lua/Debugger/LuaDebugger.cpp:1089–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087 }
1088
1089 ResultCode ContextDebugger::GetVariablesInContext(DebuggerGetVariablesRequest const& req)
1090 {
1091 LuaVirtualPin lua(GetExtensionState());
1092 if (!lua) {
1093 return ResultCode::EvalEngineNotReady;
1094 }
1095
1096 auto L = lua->GetState();
1097 DebugEvalGuard _G(*this);
1098 StackCheck _(L);
1099 StaticLifetimeStackPin _LT(lua->GetState(), lua::LifetimeHandle{});
1100 lua::ProfilerStackGuard _p(&*lua);
1101
1102 ContextDebuggerGetVarCtx ctx{ this, &req, ResultCode::Success };
1103 char const* error;
1104 if (ProtectedRunC(lua->GetState(), &ContextDebuggerGetVar, &ctx, error)) {
1105 return ctx.Result;
1106 } else {
1107 ctx.Request->Response->set_error_message(error);
1108 return ResultCode::EvalFailed;
1109 }
1110 }
1111
1112 ResultCode ContextDebugger::GetVariablesInLocal(lua_State* L, DebuggerGetVariablesRequest const& req)
1113 {

Callers 1

GetVariablesMethod · 0.95

Calls 2

ProtectedRunCFunction · 0.85
GetStateMethod · 0.80

Tested by

no test coverage detected