summaryrefslogtreecommitdiffstats
path: root/src/core/debugger/gdbstub.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-01-20 19:00:33 +0100
committerGitHub <noreply@github.com>2023-01-20 19:00:33 +0100
commitf78068d7bfaa2f2891b79bd4a0554ac242194aaa (patch)
treed54fe53cbb2df44de4107fcd25b35d76ecf77b71 /src/core/debugger/gdbstub.cpp
parentMerge pull request #9640 from german77/why_sdl (diff)
parentdebugger: add host fastmem pointer fetch command (diff)
downloadyuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar.gz
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar.bz2
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar.lz
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar.xz
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.tar.zst
yuzu-f78068d7bfaa2f2891b79bd4a0554ac242194aaa.zip
Diffstat (limited to 'src/core/debugger/gdbstub.cpp')
-rw-r--r--src/core/debugger/gdbstub.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/core/debugger/gdbstub.cpp b/src/core/debugger/gdbstub.cpp
index a64a9ac64..9c02b7b31 100644
--- a/src/core/debugger/gdbstub.cpp
+++ b/src/core/debugger/gdbstub.cpp
@@ -11,6 +11,7 @@
#include "common/hex_util.h"
#include "common/logging/log.h"
#include "common/scope_exit.h"
+#include "common/settings.h"
#include "core/arm/arm_interface.h"
#include "core/core.h"
#include "core/debugger/gdbstub.h"
@@ -731,7 +732,25 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) {
auto* process = system.CurrentProcess();
auto& page_table = process->PageTable();
- if (command_str == "get info") {
+ const char* commands = "Commands:\n"
+ " get fastmem\n"
+ " get info\n"
+ " get mappings\n";
+
+ if (command_str == "get fastmem") {
+ if (Settings::IsFastmemEnabled()) {
+ const auto& impl = page_table.PageTableImpl();
+ const auto region = reinterpret_cast<uintptr_t>(impl.fastmem_arena);
+ const auto region_bits = impl.current_address_space_width_in_bits;
+ const auto region_size = 1ULL << region_bits;
+
+ reply = fmt::format("Region bits: {}\n"
+ "Host address: {:#x} - {:#x}\n",
+ region_bits, region, region + region_size - 1);
+ } else {
+ reply = "Fastmem is not enabled.\n";
+ }
+ } else if (command_str == "get info") {
Loader::AppLoader::Modules modules;
system.GetAppLoader().ReadNSOModules(modules);
@@ -787,9 +806,10 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) {
cur_addr = next_address;
}
} else if (command_str == "help") {
- reply = "Commands:\n get info\n get mappings\n";
+ reply = commands;
} else {
- reply = "Unknown command.\nCommands:\n get info\n get mappings\n";
+ reply = "Unknown command.\n";
+ reply += commands;
}
std::span<const u8> reply_span{reinterpret_cast<u8*>(&reply.front()), reply.size()};