From 79177d17e5f17dfefaf6e4b76c19f9de997bd7d0 Mon Sep 17 00:00:00 2001 From: Konstantin Nazarov Date: Mon, 9 Dec 2024 00:48:40 +0000 Subject: [PATCH] Add clangd and clang-format configs --- .clang-format | 4 ++++ .clangd | 2 ++ src/debug.hpp | 28 ++++++++++++++++------------ 3 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .clang-format create mode 100644 .clangd diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..cf29b6c --- /dev/null +++ b/.clang-format @@ -0,0 +1,4 @@ +--- +BasedOnStyle: Google + +... diff --git a/.clangd b/.clangd new file mode 100644 index 0000000..c786f16 --- /dev/null +++ b/.clangd @@ -0,0 +1,2 @@ +CompileFlags: + Add: [-xc++, -std=c++23, -Isrc/] \ No newline at end of file diff --git a/src/debug.hpp b/src/debug.hpp index 7b49d3e..b37d9dd 100644 --- a/src/debug.hpp +++ b/src/debug.hpp @@ -1,26 +1,29 @@ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "vm.hpp" + class GDBStub { -public: + public: GDBStub(int port); ~GDBStub(); void run(); void stop(); -private: + private: int server_fd; int client_fd; std::atomic running; @@ -38,7 +41,8 @@ private: void handle_packet(const std::string &packet); - bool parse_memory_request(const std::string &packet, size_t &addr, size_t &length); + bool parse_memory_request(const std::string &packet, size_t &addr, + size_t &length); std::string read_registers();