summaryrefslogtreecommitdiffhomepage
path: root/dev/DebuggerKit/DebuggerContract.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-08-16 19:55:22 +0200
committerGitHub <noreply@github.com>2025-08-16 19:55:22 +0200
commit5467549fa5d656afd0c6bf12c6c3928a8c919591 (patch)
tree755d6bf288f0bd474641d9ace1de290991feffee /dev/DebuggerKit/DebuggerContract.h
parent433bb5ef102b2bfa0049468be00d63011da8b973 (diff)
parent0c14f7cff6535d110bc95a7699db043d8aa9aa1a (diff)
Merge pull request #9 from nekernel-org/dev
v0.0.3
Diffstat (limited to 'dev/DebuggerKit/DebuggerContract.h')
-rw-r--r--dev/DebuggerKit/DebuggerContract.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/dev/DebuggerKit/DebuggerContract.h b/dev/DebuggerKit/DebuggerContract.h
new file mode 100644
index 0000000..48c3603
--- /dev/null
+++ b/dev/DebuggerKit/DebuggerContract.h
@@ -0,0 +1,44 @@
+/***
+ (C) 2025 Amlal El Mahrouss
+ */
+
+#pragma once
+
+#include <cstdint>
+#include <string>
+#include <unordered_map>
+
+namespace DebuggerKit {
+class DebuggerContract;
+
+/// \brief Process ID
+typedef uint64_t ProcessID;
+
+/// \brief Address type, a la BSD.
+typedef char* CAddress;
+
+/// \brief Debugger contract class in C++, as per the design states.
+/// \author Amlal El Mahrouss
+class DebuggerContract {
+ public:
+ explicit DebuggerContract() = default;
+ virtual ~DebuggerContract() = default;
+
+ public:
+ DebuggerContract& operator=(const DebuggerContract&) = default;
+ DebuggerContract(const DebuggerContract&) = default;
+
+ public:
+ virtual bool Attach(std::string path, std::string argv, ProcessID& pid) noexcept = 0;
+ virtual bool BreakAt(std::string symbol) noexcept = 0;
+ virtual bool Break() noexcept = 0;
+ virtual bool Continue() noexcept = 0;
+ virtual bool Detach() noexcept = 0;
+
+ virtual std::unordered_map<uintptr_t, uintptr_t>& Get() { return m_breakpoints; }
+
+ protected:
+ ProcessID m_pid;
+ std::unordered_map<uintptr_t, uintptr_t> m_breakpoints;
+};
+} // namespace DebuggerKit