Implemented support for breakpoint caching in the GDB server

This commit is contained in:
Nav
2023-04-01 14:30:33 +01:00
parent 06b6c4460b
commit 3a74906541
13 changed files with 129 additions and 6 deletions

View File

@@ -2,12 +2,16 @@
#include <cstdint>
#include <optional>
#include <unordered_set>
#include "TargetDescriptor.hpp"
#include "GdbDebugServerConfig.hpp"
#include "Connection.hpp"
#include "Feature.hpp"
#include "ProgrammingSession.hpp"
#include "src/Targets/TargetMemory.hpp"
namespace Bloom::DebugServer::Gdb
{
class DebugSession
@@ -29,6 +33,18 @@ namespace Bloom::DebugServer::Gdb
*/
const TargetDescriptor& gdbTargetDescriptor;
/**
* The current server configuration.
*/
const GdbDebugServerConfig& serverConfig;
/**
* Internal bookkeeping of breakpoints managed by GDB. These will both remain empty if the user has disabled
* breakpoint caching.
*/
std::unordered_set<Targets::TargetMemoryAddress> breakpointAddresses;
std::unordered_set<Targets::TargetMemoryAddress> breakpointAddressesPendingRemoval;
/**
* When the GDB client is waiting for the target to halt, this is set to true so we know when to notify the
* client.
@@ -53,7 +69,8 @@ namespace Bloom::DebugServer::Gdb
DebugSession(
Connection&& connection,
const std::set<std::pair<Feature, std::optional<std::string>>>& supportedFeatures,
const TargetDescriptor& targetDescriptor
const TargetDescriptor& targetDescriptor,
const GdbDebugServerConfig& serverConfig
);
DebugSession(const DebugSession& other) = delete;