summaryrefslogtreecommitdiffhomepage
path: root/include/DebuggerKit/DebuggerContract.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-05 11:49:28 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-05 11:50:39 -0500
commit037ac38824623c13070384e8fc0e70c4770dcdbd (patch)
tree19d7286c5d226b33f10743c76436dace0cf42112 /include/DebuggerKit/DebuggerContract.h
parent5535f22998bf991eeb75a56c9e147f0fd4bd23b2 (diff)
chore! new project filesystem structure.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include/DebuggerKit/DebuggerContract.h')
-rw-r--r--include/DebuggerKit/DebuggerContract.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/DebuggerKit/DebuggerContract.h b/include/DebuggerKit/DebuggerContract.h
new file mode 100644
index 0000000..e205e26
--- /dev/null
+++ b/include/DebuggerKit/DebuggerContract.h
@@ -0,0 +1,43 @@
+/* ========================================
+
+ Copyright (C) 2025 Amlal El Mahrouss, Licensed under the Apache 2.0 license.
+
+======================================== */
+
+#pragma once
+
+#include <DebuggerKit/Detail/Config.h>
+#include <unordered_map>
+
+#define DK_DEBUGGER_CONTRACT : public ::DebuggerKit::IDebuggerContract
+
+namespace DebuggerKit {
+class IDebuggerContract;
+
+/// =========================================================== ///
+/// \brief Debugger contract class in C++, as per the design states.
+/// \author Amlal El Mahrouss
+/// =========================================================== ///
+class IDebuggerContract {
+ public:
+ explicit IDebuggerContract() = default;
+ virtual ~IDebuggerContract() = default;
+
+ public:
+ IDebuggerContract& operator=(const IDebuggerContract&) = default;
+ IDebuggerContract(const IDebuggerContract&) = 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{(ProcessID) ~0};
+ std::unordered_map<uintptr_t, uintptr_t> m_breakpoints;
+};
+} // namespace DebuggerKit