add 'step' and 'resume' commands

This commit is contained in:
MihailRis
2025-10-07 21:53:46 +03:00
parent 5972bc769b
commit 9372a5226e
6 changed files with 91 additions and 42 deletions
+20 -6
View File
@@ -3,6 +3,7 @@
#include <memory>
#include <string>
#include <vector>
#include <variant>
#include "typedefs.hpp"
@@ -36,16 +37,27 @@ namespace devtools {
u64id_t connection;
};
enum class BreakpointEventType {
enum class DebuggingEventType {
SET_BREAKPOINT = 1,
REMOVE_BREAKPOINT,
STEP,
STEP_INTO_FUNCTION,
RESUME,
};
struct BreakpointEvent {
BreakpointEventType type;
struct BreakpointEventDto {
std::string source;
int line;
};
struct SignalEventDto {
};
struct DebuggingEvent {
DebuggingEventType type;
std::variant<BreakpointEventDto, SignalEventDto> data;
};
class DebuggingServer {
public:
DebuggingServer(Engine& engine, const std::string& serverString);
@@ -55,13 +67,15 @@ namespace devtools {
void onHitBreakpoint(dv::value&& stackTrace);
void setClient(u64id_t client);
std::vector<BreakpointEvent> pullBreakpointEvents();
std::vector<DebuggingEvent> pullEvents();
private:
Engine& engine;
network::Server& server;
std::unique_ptr<ClientConnection> connection;
std::vector<BreakpointEvent> breakpointEvents;
std::vector<DebuggingEvent> breakpointEvents;
bool performCommand(const std::string& type, const dv::value& map);
bool performCommand(
const std::string& type, const dv::value& map
);
};
}