GetVariables fetches the fully traversed set of Variables from the debugger for the given reference identifier. Returns true on success, false on error.
| 794 | // for the given reference identifier. |
| 795 | // Returns true on success, false on error. |
| 796 | bool 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. |
no test coverage detected