1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Support object inspection through DAP variables request

This commit is contained in:
Ricardo Subtil
2024-09-24 21:33:29 +01:00
parent 5ccbf6e4c7
commit 6aac039ee7
3 changed files with 192 additions and 10 deletions

View File

@@ -31,12 +31,12 @@
#ifndef DEBUG_ADAPTER_PROTOCOL_H
#define DEBUG_ADAPTER_PROTOCOL_H
#include "core/io/stream_peer.h"
#include "core/io/stream_peer_tcp.h"
#include "core/io/tcp_server.h"
#include "debug_adapter_parser.h"
#include "debug_adapter_types.h"
#include "scene/debugger/scene_debugger.h"
#define DAP_MAX_BUFFER_SIZE 4194304 // 4MB
#define DAP_MAX_CLIENTS 8
@@ -75,6 +75,8 @@ class DebugAdapterProtocol : public Object {
friend class DebugAdapterParser;
using DAPVarID = int;
private:
static DebugAdapterProtocol *singleton;
DebugAdapterParser *parser = nullptr;
@@ -99,6 +101,11 @@ private:
void reset_stack_info();
int parse_variant(const Variant &p_var);
void parse_object(SceneDebuggerObject &p_obj);
const Variant parse_object_variable(const SceneDebuggerObject::SceneDebuggerProperty &p_property);
ObjectID search_object_id(DAPVarID p_var_id);
bool request_remote_object(const ObjectID &p_object_id);
bool _initialized = false;
bool _processing_breakpoint = false;
@@ -114,10 +121,13 @@ private:
int breakpoint_id = 0;
int stackframe_id = 0;
int variable_id = 0;
DAPVarID variable_id = 0;
List<DAP::Breakpoint> breakpoint_list;
HashMap<DAP::StackFrame, List<int>, DAP::StackFrame> stackframe_list;
HashMap<int, Array> variable_list;
HashMap<DAPVarID, Array> variable_list;
HashMap<ObjectID, DAPVarID> object_list;
HashSet<ObjectID> object_pending_set;
public:
friend class DebugAdapterServer;