diff options
author | Mai M <mathew1800@gmail.com> | 2022-06-01 00:19:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 00:19:49 -0400 |
commit | de2f2e5140eb85311e0fd844c580d6726adf7e03 (patch) | |
tree | 10f0e96a0689b2edb823f5833ff388ac9c645229 /src/core/core.cpp | |
parent | 72b34650f9d11ff4bc72abc88799933da2445129 (diff) | |
parent | fb4b3c127f7c390358d7f4cadd2f58de116fec48 (diff) |
Merge pull request #8394 from liamwhite/debugger
core/debugger: Implement new GDB stub debugger
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r-- | src/core/core.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 8a887904d..7d974ba65 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -17,6 +17,7 @@ #include "core/core.h" #include "core/core_timing.h" #include "core/cpu_manager.h" +#include "core/debugger/debugger.h" #include "core/device_memory.h" #include "core/file_sys/bis_factory.h" #include "core/file_sys/mode.h" @@ -171,6 +172,10 @@ struct System::Impl { } } + void InitializeDebugger(System& system, u16 port) { + debugger = std::make_unique<Debugger>(system, port); + } + SystemResultStatus Init(System& system, Frontend::EmuWindow& emu_window) { LOG_DEBUG(Core, "initialized OK"); @@ -329,6 +334,7 @@ struct System::Impl { gpu_core->NotifyShutdown(); } + debugger.reset(); services.reset(); service_manager.reset(); cheat_engine.reset(); @@ -436,6 +442,9 @@ struct System::Impl { /// Network instance Network::NetworkInstance network_instance; + /// Debugger + std::unique_ptr<Core::Debugger> debugger; + SystemResultStatus status = SystemResultStatus::Success; std::string status_details = ""; @@ -472,10 +481,6 @@ SystemResultStatus System::Pause() { return impl->Pause(); } -SystemResultStatus System::SingleStep() { - return SystemResultStatus::Success; -} - void System::InvalidateCpuInstructionCaches() { impl->kernel.InvalidateAllInstructionCaches(); } @@ -496,6 +501,10 @@ void System::UnstallCPU() { impl->UnstallCPU(); } +void System::InitializeDebugger() { + impl->InitializeDebugger(*this, Settings::values.gdbstub_port.GetValue()); +} + SystemResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, u64 program_id, std::size_t program_index) { return impl->Load(*this, emu_window, filepath, program_id, program_index); @@ -809,6 +818,18 @@ bool System::IsMulticore() const { return impl->is_multicore; } +bool System::DebuggerEnabled() const { + return Settings::values.use_gdbstub.GetValue(); +} + +Core::Debugger& System::GetDebugger() { + return *impl->debugger; +} + +const Core::Debugger& System::GetDebugger() const { + return *impl->debugger; +} + void System::RegisterExecuteProgramCallback(ExecuteProgramCallback&& callback) { impl->execute_program_callback = std::move(callback); } |