Compare commits

...

151 Commits

Author SHA1 Message Date
Jarek Syrylak
1f15c33c60 Fix typo 2018-08-06 16:57:35 +01:00
Jarek Syrylak
9a3de91a52 Refactor invalidation and check for instruction cache validity as suggested in PR thread 2018-08-06 16:00:44 +01:00
Jarek Syrylak
a86291274f Merge remote-tracking branch 'remotes/origin/GDBClean' into GDBWork 2018-08-06 13:48:18 +01:00
Jarek Syrylak
adccf27874 Remove no longer needed static keyword 2018-08-06 13:42:42 +01:00
Jarek Syrylak
350870a498 GDBStub works with both Unicorn and Dynarmic now 2018-08-06 13:36:55 +01:00
Jarek Syrylak
01095d8f9f Tidy up 2018-08-06 12:43:05 +01:00
Jarek Syrylak
5b69162612 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-08-06 12:03:58 +01:00
Jarek Syrylak
a9b8739d0c Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-08-05 22:12:39 +01:00
Jarek Syrylak
bfbf9bae00 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-08-05 17:52:50 +01:00
Jarek Syrylak
0321cd69fa Fix for bad merge 2018-08-05 03:02:48 +01:00
Jarek Syrylak
09649c6053 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-08-05 02:41:41 +01:00
Jarek Syrylak
c7bb6d2537 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-28 21:02:07 +01:00
Jarek Syrylak
2c3069f590 Temporary hack to let app finish even if it is calling unimplemented transaction 2018-07-28 13:18:34 +01:00
Jarek Syrylak
bfcad07dc0 Enable RomFS for NROs plus some minor formatting. 2018-07-28 09:51:15 +01:00
Jarek Syrylak
c47b775200 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-28 09:01:17 +01:00
Jarek Syrylak
75994ac751 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-27 20:50:18 +01:00
Jarek Syrylak
0017aff7fb Use flag rather than instruction count to handle step mode. 2018-07-27 10:12:40 +01:00
Jarek Syrylak
035e893c5b Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-27 10:01:00 +01:00
Jarek Syrylak
bf147035c8 Invalidate instruction cache on GDB events for Dynarmic 2018-07-26 18:22:53 +01:00
Jarek Syrylak
e248a70ffe Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-26 10:15:58 +01:00
Jarek Syrylak
7c0bdf937a Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-25 10:01:58 +01:00
Jarek Syrylak
bc523f58ec Merge branch 'GDBWork' of https://github.com/Hedges/yuzu into GDBWork 2018-07-23 15:10:13 +01:00
Jarek Syrylak
c2d6c6a3d4 Interfacing GDBStub with Dynarmic wip. 2018-07-23 15:08:25 +01:00
Jarek Syrylak
bfb96d05f5 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-23 11:27:32 +01:00
Jarek Syrylak
ccd787b88a Updated externals 2018-07-22 21:24:30 +01:00
Jarek Syrylak
17106dafde Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-22 20:29:28 +01:00
Jarek Syrylak
15cfd736aa Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-22 20:28:21 +01:00
Jarek Syrylak
2ec78ce62e Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-21 11:29:17 +01:00
Jarek Syrylak
8cfc1046a6 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-20 20:15:10 +01:00
Jarek Syrylak
4dbc822422 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-20 10:04:31 +01:00
Jarek Syrylak
9f26affb8e Merge branch 'GDBWork' of https://github.com/Hedges/yuzu into GDBWork 2018-07-19 17:47:12 +01:00
Jarek Syrylak
6662a695e9 Work towards interfacing with Dynarmic. 2018-07-19 17:43:18 +01:00
Jarek Syrylak
1046a4d6c3 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-19 10:00:32 +01:00
Jarek Syrylak
b0b2942d00 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-18 11:08:54 +01:00
Jarek Syrylak
c565eead88 Merge branch 'master' of https://github.com/yuzu-emu/yuzu into GDBWork 2018-07-16 12:29:38 +01:00
Jarek Syrylak
d69a2d0e6a Tidy up as requested in PR feedback 2018-07-12 22:55:27 +01:00
Jarek Syrylak
2db0203317 Tidy up as requested in PR feedback 2018-07-12 21:18:09 +01:00
Jarek Syrylak
7b4cd8f895 More improvements to GDBStub
- Debugging of threads should work correctly with source and assembly level stepping and modifying registers and memory, meaning threads and callstacks are fully clickable in VS.
- List of modules is available to the client, with assumption that .nro and .nso are backed up by an .elf with symbols, while deconstructed ROMs keep N names.
- Initial support for floating point registers.
2018-07-12 20:09:20 +01:00
Jarek Syrylak
d828b7b479 Merge branch 'master' of https://github.com/Hedges/yuzu 2018-07-12 19:18:04 +01:00
Jarek Syrylak
85d02d07fc This auto should not actually be const 2018-07-12 17:53:47 +01:00
Jarek Syrylak
5a9ba8342f More tidy up as per comments on pull request 2018-07-12 17:41:14 +01:00
Jarek Syrylak
21a2512cfb More tidy up as per comments on pull request 2018-07-12 15:46:31 +01:00
Jarek Syrylak
33ac8e9a85 Tidy up as per comments on pull request 2018-07-12 12:23:12 +01:00
Jarek Syrylak
eca5df2573 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-12 09:38:35 +01:00
Jarek Syrylak
9efc5c1ddb Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-11 23:40:17 +01:00
Jarek Syrylak
39840bd511 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-11 17:23:37 +01:00
Jarek Syrylak
7b31bed043 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-11 10:04:28 +01:00
Jarek Syrylak
dd73661717 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-10 22:10:23 +01:00
Jarek Syrylak
d909d700ce Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-10 17:50:16 +01:00
Jarek Syrylak
198805b0fa Revert bad merge/rebase 2018-07-10 17:22:24 +01:00
Jarek Syrylak
05a019d4ee Merge branch 'master' of https://github.com/Hedges/yuzu 2018-07-10 16:39:04 +01:00
Jarek Syrylak
4b22a64d63 Compile fixes for Linux and macOS 2018-07-10 16:38:24 +01:00
Jarek Syrylak
e652110fda Register all loaded modules with GDBStub 2018-07-10 16:38:23 +01:00
Jarek Syrylak
9cb1f759ca Avoid crash in IsValidVirtualAddress() 2018-07-10 16:38:16 +01:00
Jarek Syrylak
4a657f5fb6 Register module with GDBStub. 2018-07-10 16:38:08 +01:00
Jarek Syrylak
20a3fbcc5a Fix handler for libraries query. 2018-07-10 16:38:01 +01:00
Jarek Syrylak
490893f119 Register NRO module. 2018-07-10 16:38:01 +01:00
Jarek Syrylak
430903a1ba Fix splitpath on Windows. 2018-07-10 16:38:00 +01:00
Jarek Syrylak
f7e6e204da Some cleanup. 2018-07-10 16:38:00 +01:00
Jarek Syrylak
1ffd10ce18 Add support for NSO modules. 2018-07-10 16:38:00 +01:00
Jarek Syrylak
c2ad530279 Initial support for floating point registers (wip). 2018-07-10 16:37:46 +01:00
Jarek Syrylak
625558e7b0 Reload registers from thread context after they have been changed in GDBStub. 2018-07-10 16:37:46 +01:00
Jarek Syrylak
fb8e336e95 Tidy up. 2018-07-10 16:37:45 +01:00
Jarek Syrylak
68e5f369c1 More improvements and diagnostics for GDBStub. 2018-07-10 16:37:45 +01:00
Jarek Syrylak
2f465d7572 More improvements and diagnostics for GDBStub. 2018-07-10 16:37:38 +01:00
Jarek Syrylak
c3ec14616f More improvements and diagnostics for GDBStub. 2018-07-10 16:37:38 +01:00
Jarek Syrylak
7e7f94f559 More improvements and diagnostics for GDBStub. 2018-07-10 16:37:38 +01:00
Jarek Syrylak
6bd605cb61 Work towards improving handling of threads in GDBStub. 2018-07-10 16:37:37 +01:00
Jarek Syrylak
b412594127 Extra diagnostics for multi-threaded breaks. 2018-07-10 16:37:37 +01:00
Jarek Syrylak
7f342ce736 In step mode only signal trap from current thread, in run mode signal always. 2018-07-10 16:37:37 +01:00
Jarek Syrylak
b5e29babc5 Looking for a thread by its id should _not_ set it as a current thread!
Returning proper list of threads for better integration with VS debugger.
2018-07-10 16:37:37 +01:00
Jarek Syrylak
008a2d35d8 Only send traps from GDB's current thread, otherwise we will always be thrown back to main thread when stepping. 2018-07-10 16:37:36 +01:00
Jarek Syrylak
f8f0913e2e Tidy up. 2018-07-10 16:37:36 +01:00
Jarek Syrylak
fdf73c177b Replaced htonll with swap64. 2018-07-10 16:37:36 +01:00
Jarek Syrylak
7212fd5227 Applied clang-format. 2018-07-10 16:37:35 +01:00
Jarek Syrylak
341517a5f2 GDB Stub should work now. 2018-07-10 16:37:35 +01:00
Jarek Syrylak
31bc72dd5b Compile fixes for Linux and macOS 2018-07-10 11:28:36 +01:00
Jarek Syrylak
bee01b8e6c Register all loaded modules with GDBStub 2018-07-10 11:02:34 +01:00
Jarek Syrylak
813fab2046 Avoid crash in IsValidVirtualAddress() 2018-07-10 10:25:34 +01:00
Jarek Syrylak
2b091f642f Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-10 10:21:50 +01:00
Jarek Syrylak
e39769b78a Merge branch 'master' of https://github.com/Hedges/yuzu 2018-07-09 09:52:19 +01:00
Jarek Syrylak
20f6ac28f9 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-08 11:01:43 +01:00
Jarek Syrylak
75767354c6 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-07 22:21:35 +01:00
Jarek Syrylak
35a3eb3467 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-07 10:14:07 +01:00
Jarek Syrylak
cdf1682f79 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-07 10:13:45 +01:00
Jarek Syrylak
7246b03e45 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-06 10:18:00 +01:00
Jarek Syrylak
1ba63bd4d7 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-05 19:33:38 +01:00
Jarek Syrylak
36460b5d58 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-05 17:54:26 +01:00
Jarek Syrylak
732b8305de Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-05 09:53:51 +01:00
Jarek Syrylak
22c008ea20 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-04 22:13:56 +01:00
Jarek Syrylak
c30cf74ef8 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-04 10:02:31 +01:00
Jarek Syrylak
3274826d28 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-03 19:00:24 +01:00
Jarek Syrylak
f69c7d738b Merge branch 'master' of https://github.com/Hedges/yuzu 2018-07-03 19:00:12 +01:00
Jarek Syrylak
c3e39280e6 Register module with GDBStub. 2018-07-03 09:59:38 +01:00
Jarek Syrylak
f18b555c4d Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-03 09:57:20 +01:00
Jarek Syrylak
9e73c92f3e Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-02 18:53:03 +01:00
Jarek Syrylak
ab7567e048 Merge branch 'master' of https://github.com/Hedges/yuzu 2018-07-02 09:55:15 +01:00
Jarek Syrylak
1cb53177cc Fix handler for libraries query. 2018-07-02 00:15:21 +01:00
Jarek Syrylak
38acb2a835 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-07-01 22:08:17 +01:00
Jarek Syrylak
aa020b7a9b Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-30 12:30:22 +01:00
Jarek Syrylak
90539362bc Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-29 00:10:19 +01:00
Jarek Syrylak
99acda51d2 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-28 09:56:31 +01:00
Jarek Syrylak
e7b518e8dd Register NRO module. 2018-06-27 23:47:51 +01:00
Jarek Syrylak
917db5cafe Fix splitpath on Windows. 2018-06-27 23:47:27 +01:00
Jarek Syrylak
1f73848198 Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-27 19:23:23 +01:00
Jarek Syrylak
82058c7275 Some cleanup. 2018-06-27 17:35:57 +01:00
Jarek Syrylak
1a18c59964 Add support for NSO modules. 2018-06-27 16:22:30 +01:00
Jarek Syrylak
f2d69f0dd9 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-27 10:35:09 +01:00
Jarek Syrylak
d4ec24bdbb Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-26 19:30:21 +01:00
Jarek Syrylak
f684b02719 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-26 10:10:05 +01:00
Jarek Syrylak
5c5950bd9e Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-25 10:00:26 +01:00
Jarek Syrylak
538418e4b0 Initial support for floating point registers (wip). 2018-06-24 23:06:07 +01:00
Jarek Syrylak
72fd238ff2 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-24 11:22:59 +01:00
Jarek Syrylak
74e3b223b7 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-23 13:11:42 +01:00
Jarek Syrylak
5d0afdeae6 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-22 22:15:37 +01:00
Jarek Syrylak
b0c05f5e86 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-21 10:05:27 +01:00
Jarek Syrylak
7f6bf91050 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-19 17:33:56 +01:00
Jarek Syrylak
ffa6a3dd5c Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-19 09:46:32 +01:00
Jarek Syrylak
a8026d328f Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-18 15:01:58 +01:00
Jarek Syrylak
b0067bb3e5 Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-12 19:16:27 +01:00
Jarek Syrylak
a35755dab8 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-12 16:41:20 +01:00
Jarek Syrylak
c5445c764d Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-11 17:08:25 +01:00
Jarek Syrylak
c40e897bc0 Reload registers from thread context after they have been changed in GDBStub. 2018-06-11 14:53:47 +01:00
Jarek Syrylak
01c168a460 Tidy up. 2018-06-11 09:50:40 +01:00
Jarek Syrylak
098fb7438e Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-11 09:42:25 +01:00
Jarek Syrylak
1d1646e53f Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-10 23:40:10 +01:00
Jarek Syrylak
4ab40a08ff Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-09 16:59:18 +01:00
Jarek Syrylak
6b37634175 More improvements and diagnostics for GDBStub. 2018-06-09 16:41:41 +01:00
Jarek Syrylak
e0ceb4ed70 More improvements and diagnostics for GDBStub. 2018-06-09 15:16:56 +01:00
Jarek Syrylak
806de51c6a More improvements and diagnostics for GDBStub. 2018-06-09 10:58:18 +01:00
Jarek Syrylak
f21550c836 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-09 10:25:29 +01:00
Jarek Syrylak
2adb30a137 More improvements and diagnostics for GDBStub. 2018-06-09 10:24:55 +01:00
Jarek Syrylak
1c002e1acc Work towards improving handling of threads in GDBStub. 2018-06-08 18:35:34 +01:00
Jarek Syrylak
d0d834ad2d Extra diagnostics for multi-threaded breaks. 2018-06-08 01:03:24 +01:00
Jarek Syrylak
56a5d60276 In step mode only signal trap from current thread, in run mode signal always. 2018-06-07 23:40:03 +01:00
Jarek Syrylak
4346150b6f Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-07 19:45:08 +01:00
Jarek Syrylak
586c14670e Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-07 19:44:48 +01:00
Jarek Syrylak
5ce0d95f1c Looking for a thread by its id should _not_ set it as a current thread!
Returning proper list of threads for better integration with VS debugger.
2018-06-07 18:20:33 +01:00
Jarek Syrylak
f76bceb714 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-07 09:53:34 +01:00
Jarek Syrylak
1615d56d0f Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-06 21:12:27 +01:00
Jarek Syrylak
2f61f8ff13 Only send traps from GDB's current thread, otherwise we will always be thrown back to main thread when stepping. 2018-06-06 15:05:23 +01:00
Jarek Syrylak
cbadda89c1 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-06 14:59:23 +01:00
Jarek Syrylak
ae86329474 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-06 09:45:23 +01:00
Jarek Syrylak
b0d52753c1 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-05 19:22:30 +01:00
Jarek Syrylak
8171771fa8 Merge branch 'master' of https://github.com/Hedges/yuzu 2018-06-05 19:22:05 +01:00
Jarek Syrylak
f3ea3523b2 Tidy up. 2018-06-05 12:56:02 +01:00
Jarek Syrylak
84963f2f20 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-04 23:37:50 +01:00
Jarek Syrylak
33a4892279 Merge branch 'master' of https://github.com/yuzu-emu/yuzu 2018-06-04 22:23:05 +01:00
Jarek Syrylak
f417fbcd47 Replaced htonll with swap64. 2018-06-04 17:05:07 +01:00
Jarek Syrylak
62fd45d040 Applied clang-format. 2018-06-04 16:46:08 +01:00
Jarek Syrylak
a78a5003fa GDB Stub should work now. 2018-06-04 16:03:01 +01:00
11 changed files with 53 additions and 12 deletions

View File

@@ -10,6 +10,7 @@
#include "core/arm/dynarmic/arm_dynarmic.h"
#include "core/core.h"
#include "core/core_timing.h"
#include "core/gdbstub/gdbstub.h"
#include "core/hle/kernel/process.h"
#include "core/hle/kernel/svc.h"
#include "core/memory.h"

View File

@@ -203,7 +203,7 @@ void ARM_Unicorn::ExecuteInstructions(int num_instructions) {
}
Kernel::Thread* thread = Kernel::GetCurrentThread();
SaveContext(thread->context);
if (last_bkpt_hit || (num_instructions == 1)) {
if (last_bkpt_hit || GDBStub::GetCpuStepFlag()) {
last_bkpt_hit = false;
GDBStub::Break();
GDBStub::SendTrap(thread, 5);

View File

@@ -62,7 +62,6 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
// execute. Otherwise, get out of the loop function.
if (GDBStub::GetCpuHaltFlag()) {
if (GDBStub::GetCpuStepFlag()) {
GDBStub::SetCpuStepFlag(false);
tight_loop = false;
} else {
return ResultStatus::Success;
@@ -78,6 +77,11 @@ System::ResultStatus System::RunLoop(bool tight_loop) {
}
}
if (GDBStub::IsServerEnabled()) {
GDBStub::SetCpuStepFlag(false);
GDBStub::SetInstCacheValidity(true);
}
return status;
}

View File

@@ -82,6 +82,17 @@ public:
*/
ResultStatus SingleStep();
/**
* Invalidate the CPU instruction caches
* This function should only be used by GDBStub which is supposed to keep things
* synch'ed to its internal instruction cache validity flag.
*/
void InvalidateCpuInstructionCaches() {
for (auto& cpu : cpu_cores) {
cpu->ArmInterface().ClearInstructionCache();
}
}
/// Shutdown the emulated system.
void Shutdown();

View File

@@ -160,6 +160,7 @@ u16 gdbstub_port = 24689;
bool halt_loop = true;
bool step_loop = false;
bool send_trap = false;
bool inst_cache_valid = true;
// If set to false, the server will never be started and no
// gdbstub-related functions will be executed.
@@ -173,6 +174,7 @@ struct Breakpoint {
bool active;
VAddr addr;
u64 len;
u8 inst[4];
};
using BreakpointMap = std::map<VAddr, Breakpoint>;
@@ -453,6 +455,8 @@ static void RemoveBreakpoint(BreakpointType type, VAddr addr) {
LOG_DEBUG(Debug_GDBStub, "gdb: removed a breakpoint: {:016X} bytes at {:016X} of type {}",
bp->second.len, bp->second.addr, static_cast<int>(type));
Memory::WriteBlock(bp->second.addr, bp->second.inst, 4);
GDBStub::SetInstCacheValidity(false);
p.erase(addr);
}
@@ -937,6 +941,7 @@ static void WriteMemory() {
GdbHexToMem(data.data(), len_pos + 1, len);
Memory::WriteBlock(addr, data.data(), len);
GDBStub::SetInstCacheValidity(false);
SendReply("OK");
}
@@ -956,6 +961,7 @@ static void Step() {
step_loop = true;
halt_loop = true;
send_trap = true;
GDBStub::SetInstCacheValidity(false);
}
/// Tell the CPU if we hit a memory breakpoint.
@@ -972,6 +978,7 @@ static void Continue() {
memory_break = false;
step_loop = false;
halt_loop = false;
GDBStub::SetInstCacheValidity(false);
}
/**
@@ -988,6 +995,10 @@ static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) {
breakpoint.active = true;
breakpoint.addr = addr;
breakpoint.len = len;
Memory::ReadBlock(addr, breakpoint.inst, 4);
static const u8 btrap[] = {0xd4, 0x20, 0x7d, 0x00};
Memory::WriteBlock(addr, btrap, 4);
GDBStub::SetInstCacheValidity(false);
p.insert({addr, breakpoint});
LOG_DEBUG(Debug_GDBStub, "gdb: added {} breakpoint: {:016X} bytes at {:016X}",
@@ -1305,4 +1316,15 @@ void SendTrap(Kernel::Thread* thread, int trap) {
send_trap = false;
}
}
void SetInstCacheValidity(bool is_valid) {
inst_cache_valid = is_valid;
if (!inst_cache_valid) {
Core::System::GetInstance().InvalidateCpuInstructionCaches();
}
}
bool GetInstCacheValidity() {
return inst_cache_valid;
}
}; // namespace GDBStub

View File

@@ -104,4 +104,10 @@ void SetCpuStepFlag(bool is_step);
* @param trap Trap no.
*/
void SendTrap(Kernel::Thread* thread, int trap);
/// Set instruction cache validity.
void SetInstCacheValidity(bool is_valid);
/// Get instruction cache validity.
bool GetInstCacheValidity();
} // namespace GDBStub

View File

@@ -296,6 +296,10 @@ void RegisterFileSystems() {
auto sdcard = std::make_unique<FileSys::SDMCFactory>(std::move(sd_directory));
sdmc_factory = std::move(sdcard);
auto romfs =
std::make_unique<FileSys::RomFSFactory>(Core::System::GetInstance().GetAppLoader());
romfs_factory = std::move(romfs);
}
void InstallInterfaces(SM::ServiceManager& service_manager) {

View File

@@ -551,7 +551,7 @@ private:
} else if (transaction == TransactionId::CancelBuffer) {
LOG_CRITICAL(Service_VI, "(STUBBED) called, transaction=CancelBuffer");
} else {
ASSERT_MSG(false, "Unimplemented");
UNIMPLEMENTED();
}
IPC::ResponseBuilder rb{ctx, 2};

View File

@@ -22,13 +22,6 @@
<string>GDB</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_1">
<property name="text">
<string>The GDB Stub only works correctly when the CPU JIT is off.</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>