Add clangd and clang-format configs

This commit is contained in:
Konstantin Nazarov 2024-12-09 00:48:40 +00:00
parent fd67be0d89
commit 79177d17e5
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
3 changed files with 22 additions and 12 deletions

4
.clang-format Normal file
View file

@ -0,0 +1,4 @@
---
BasedOnStyle: Google
...

2
.clangd Normal file
View file

@ -0,0 +1,2 @@
CompileFlags:
Add: [-xc++, -std=c++23, -Isrc/]

View file

@ -1,26 +1,29 @@
#pragma once
#include <iostream>
#include <cstring>
#include <stdexcept>
#include <thread>
#include <atomic>
#include <vector>
#include <sstream>
#include <iomanip>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <unistd.h>
#include <atomic>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include <thread>
#include <vector>
#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<bool> 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();