diff options
author | Ricardo Subtil <ricasubtil@gmail.com> | 2024-09-24 21:33:29 +0100 |
---|---|---|
committer | Ricardo Subtil <ricasubtil@gmail.com> | 2024-10-03 21:28:38 +0100 |
commit | 6aac039ee7803375bfc46f2c43794c9807ab9dd5 (patch) | |
tree | 0148ac06009162c130d45a92cd4c8084218ec41c /editor/debugger/debug_adapter/debug_adapter_protocol.h | |
parent | 5ccbf6e4c794a4e47456edd9434b75fcd6096a2f (diff) | |
download | redot-engine-6aac039ee7803375bfc46f2c43794c9807ab9dd5.tar.gz |
Support object inspection through DAP `variables` request
Diffstat (limited to 'editor/debugger/debug_adapter/debug_adapter_protocol.h')
-rw-r--r-- | editor/debugger/debug_adapter/debug_adapter_protocol.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.h b/editor/debugger/debug_adapter/debug_adapter_protocol.h index caff0f9c7f..29d7457ee7 100644 --- a/editor/debugger/debug_adapter/debug_adapter_protocol.h +++ b/editor/debugger/debug_adapter/debug_adapter_protocol.h @@ -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; |