add 'set-breakpoint', 'remove-breakpoint' commands

This commit is contained in:
MihailRis
2025-10-07 21:07:02 +03:00
parent 95f30da49b
commit 5972bc769b
6 changed files with 114 additions and 2 deletions
+13
View File
@@ -2,6 +2,7 @@
#include <memory>
#include <string>
#include <vector>
#include "typedefs.hpp"
@@ -35,6 +36,16 @@ namespace devtools {
u64id_t connection;
};
enum class BreakpointEventType {
SET_BREAKPOINT = 1,
REMOVE_BREAKPOINT,
};
struct BreakpointEvent {
BreakpointEventType type;
std::string source;
int line;
};
class DebuggingServer {
public:
DebuggingServer(Engine& engine, const std::string& serverString);
@@ -44,10 +55,12 @@ namespace devtools {
void onHitBreakpoint(dv::value&& stackTrace);
void setClient(u64id_t client);
std::vector<BreakpointEvent> pullBreakpointEvents();
private:
Engine& engine;
network::Server& server;
std::unique_ptr<ClientConnection> connection;
std::vector<BreakpointEvent> breakpointEvents;
bool performCommand(const std::string& type, const dv::value& map);
};