diff options
| author | 2023-01-12 18:35:14 -0500 | |
|---|---|---|
| committer | 2023-01-12 18:35:14 -0500 | |
| commit | e9c3d16f6fdb7bbd16aab28ddfd9bb8617f0090b (patch) | |
| tree | 5ab75571dfac1d787cb10a186648434910a57fe9 /src | |
| parent | Merge pull request #9605 from german77/mouse_mapping (diff) | |
| download | yuzu-e9c3d16f6fdb7bbd16aab28ddfd9bb8617f0090b.tar.gz yuzu-e9c3d16f6fdb7bbd16aab28ddfd9bb8617f0090b.tar.xz yuzu-e9c3d16f6fdb7bbd16aab28ddfd9bb8617f0090b.zip | |
debugger: add host fastmem pointer fetch command
Diffstat (limited to '')
| -rw-r--r-- | src/core/debugger/gdbstub.cpp | 26 |
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 @@ | |||
| 11 | #include "common/hex_util.h" | 11 | #include "common/hex_util.h" |
| 12 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 13 | #include "common/scope_exit.h" | 13 | #include "common/scope_exit.h" |
| 14 | #include "common/settings.h" | ||
| 14 | #include "core/arm/arm_interface.h" | 15 | #include "core/arm/arm_interface.h" |
| 15 | #include "core/core.h" | 16 | #include "core/core.h" |
| 16 | #include "core/debugger/gdbstub.h" | 17 | #include "core/debugger/gdbstub.h" |
| @@ -731,7 +732,25 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) { | |||
| 731 | auto* process = system.CurrentProcess(); | 732 | auto* process = system.CurrentProcess(); |
| 732 | auto& page_table = process->PageTable(); | 733 | auto& page_table = process->PageTable(); |
| 733 | 734 | ||
| 734 | if (command_str == "get info") { | 735 | const char* commands = "Commands:\n" |
| 736 | " get fastmem\n" | ||
| 737 | " get info\n" | ||
| 738 | " get mappings\n"; | ||
| 739 | |||
| 740 | if (command_str == "get fastmem") { | ||
| 741 | if (Settings::IsFastmemEnabled()) { | ||
| 742 | const auto& impl = page_table.PageTableImpl(); | ||
| 743 | const auto region = reinterpret_cast<uintptr_t>(impl.fastmem_arena); | ||
| 744 | const auto region_bits = impl.current_address_space_width_in_bits; | ||
| 745 | const auto region_size = 1ULL << region_bits; | ||
| 746 | |||
| 747 | reply = fmt::format("Region bits: {}\n" | ||
| 748 | "Host address: {:#x} - {:#x}\n", | ||
| 749 | region_bits, region, region + region_size - 1); | ||
| 750 | } else { | ||
| 751 | reply = "Fastmem is not enabled.\n"; | ||
| 752 | } | ||
| 753 | } else if (command_str == "get info") { | ||
| 735 | Loader::AppLoader::Modules modules; | 754 | Loader::AppLoader::Modules modules; |
| 736 | system.GetAppLoader().ReadNSOModules(modules); | 755 | system.GetAppLoader().ReadNSOModules(modules); |
| 737 | 756 | ||
| @@ -787,9 +806,10 @@ void GDBStub::HandleRcmd(const std::vector<u8>& command) { | |||
| 787 | cur_addr = next_address; | 806 | cur_addr = next_address; |
| 788 | } | 807 | } |
| 789 | } else if (command_str == "help") { | 808 | } else if (command_str == "help") { |
| 790 | reply = "Commands:\n get info\n get mappings\n"; | 809 | reply = commands; |
| 791 | } else { | 810 | } else { |
| 792 | reply = "Unknown command.\nCommands:\n get info\n get mappings\n"; | 811 | reply = "Unknown command.\n"; |
| 812 | reply += commands; | ||
| 793 | } | 813 | } |
| 794 | 814 | ||
| 795 | std::span<const u8> reply_span{reinterpret_cast<u8*>(&reply.front()), reply.size()}; | 815 | std::span<const u8> reply_span{reinterpret_cast<u8*>(&reply.front()), reply.size()}; |