From f90a022d3a20c86399f49a8154847b73bc1b8fd3 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 2 Jan 2024 17:12:16 -0500 Subject: kernel: fix debugger and process list lifetime --- src/core/debugger/gdbstub.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/core/debugger/gdbstub.h') diff --git a/src/core/debugger/gdbstub.h b/src/core/debugger/gdbstub.h index 368197920..232dcf49f 100644 --- a/src/core/debugger/gdbstub.h +++ b/src/core/debugger/gdbstub.h @@ -12,13 +12,22 @@ #include "core/debugger/debugger_interface.h" #include "core/debugger/gdbstub_arch.h" +namespace Kernel { +class KProcess; +} + +namespace Core::Memory { +class Memory; +} + namespace Core { class System; class GDBStub : public DebuggerFrontend { public: - explicit GDBStub(DebuggerBackend& backend, Core::System& system); + explicit GDBStub(DebuggerBackend& backend, Core::System& system, + Kernel::KProcess* debug_process); ~GDBStub() override; void Connected() override; @@ -42,8 +51,12 @@ private: void SendReply(std::string_view data); void SendStatus(char status); + Kernel::KProcess* GetProcess(); + Core::Memory::Memory& GetMemory(); + private: Core::System& system; + Kernel::KProcess* debug_process; std::unique_ptr arch; std::vector current_command; std::map replaced_instructions; -- cgit v1.2.3