MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / getVariables

Method getVariables

src/plugins/debugger/dap/debugsession.cpp:796–818  ·  view source on GitHub ↗

GetVariables fetches the fully traversed set of Variables from the debugger for the given reference identifier. Returns true on success, false on error.

Source from the content-addressed store, hash-verified

794// for the given reference identifier.
795// Returns true on success, false on error.
796bool DebugSession::getVariables(dap::integer variablesRef, IVariables *out, dap::integer depth/* = 0*/)
797{
798 if (depth > 5)
799 return false;
800
801 dap::VariablesRequest request;
802 request.variablesReference = variablesRef;
803 auto response = raw->variables(request);
804 if (!response.valid()) {
805 return false;
806 }
807
808 array<Variable> &&variables = response.get().response.variables;
809
810 for (auto var : variables) {
811 IVariable v;
812 v.name = var.name;
813 v.var = var;
814 v.depth = depth + 1;
815 out->push_back(v);
816 }
817 return true;
818}
819
820// GetLocals fetches the fully traversed set of local Variables from the
821// debugger for the given stack frame.

Callers 1

slotGetChildVariableMethod · 0.80

Calls 3

variablesMethod · 0.45
validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected