Compare commits

..

27 commits

Author SHA1 Message Date
Coxxs
1b37038d5a gdb: Log CommandReadMemory failure 2025-06-24 08:34:12 +08:00
Coxxs
cd2a7c9916 gdb: Prevent BreakHandler being called multiple times from the same breakpoint 2025-06-24 08:34:12 +08:00
Coxxs
669179ca2e gdb: Adjust Settings UI 2025-06-24 08:34:12 +08:00
Coxxs
b1c1ad54e8 gdb: Fix single-stepping of branch instructions 2025-06-24 08:34:12 +08:00
Coxxs
c4abaa6cf2 gdb: Allow PTC cache when GDB Stub is enabled 2025-06-24 08:34:12 +08:00
Coxxs
c5c8647de7 gdb: Invalidate PTC cache when GDB Stub is enabled/disabled 2025-06-24 08:34:11 +08:00
Coxxs
838296ccb6 gdb: Support precise tracking of PC value when GDB Stub is enabled 2025-06-24 08:34:11 +08:00
Coxxs
009d319bc2 gdb: Implement QRcmd (monitor) commands
monitor backtrace (mo bt)
monitor registers (mo reg)
monitor get info
2025-06-24 08:34:11 +08:00
Coxxs
7d189ab2c0 gdb: Revert ExecutionContext for now
Pc isn't reliable either
2025-06-24 08:34:11 +08:00
Coxxs
bad1dd8899 gdb: Implement z0/Z0 software breakpoints 2025-06-24 08:34:11 +08:00
Coxxs
7d5f7bc479 gdb: Implement vCont to support step on AArch32 2025-06-24 08:34:11 +08:00
Coxxs
44f4e9af51 gdb: Do not use LightningJitEngine when GDB Stub is enabled 2025-06-24 08:34:11 +08:00
Coxxs
fe02ff3a3a gdb: Fix ExecutionContext 2025-06-24 08:34:11 +08:00
Coxxs
9506eba982 gdb: Show thread names
Reference: d8a37b4b71/libraries/libstratosphere/source/osdbg/impl/osdbg_thread_type.os.horizon.hpp
2025-06-24 08:34:11 +08:00
Coxxs
5cad23f793 gdb: Set correct gThread and cThread when break 2025-06-24 08:34:11 +08:00
Coxxs
fb1655f1ad gdb: Update DebugPc during SVC call and break 2025-06-24 08:34:11 +08:00
Coxxs
f630d5ba99 gdb: Fix crash when gdb client disconnected in some cases 2025-06-24 08:34:11 +08:00
Coxxs
bc68502179 gdb: Add timeout to prevent deadlock in DebugStep
Deadlock can happen when step at some svc instructions.
2025-06-24 08:34:11 +08:00
Coxxs
e547c4f5f4 gdb: Fix GdbWriteRegister endianness 2025-06-24 08:34:11 +08:00
Coxxs
36bb910e67 gdb: Fix crash on stop emulation if gdb stub is enabled with app running 2025-06-24 08:34:11 +08:00
Coxxs
785641a402 gdb: Remove unused using 2025-06-24 08:34:11 +08:00
Coxxs
d81dca0dcc gdb: Add notice when application is suspended on start 2025-06-24 08:34:11 +08:00
Coxxs
737afbfa2f gdb: Wait for the application to start if user connect gdb too early 2025-06-24 08:34:11 +08:00
Coxxs
8682c51ef7 gdb: Fix crash on exit when not using Debugger 2025-06-24 08:34:11 +08:00
Coxxs
bbbbaaa669 gdb: Remove redundant log 2025-06-24 08:34:11 +08:00
Coxxs
890165707a Add GDB Stub
Author: merry, svc64
2025-06-24 08:34:11 +08:00
Neo
0cc94fdf37 Update French Translation (ryubing/ryujinx!67)
See merge request ryubing/ryujinx!67
2025-06-23 14:50:47 -05:00
2 changed files with 289 additions and 279 deletions

File diff suppressed because it is too large Load diff

View file

@ -32,6 +32,7 @@ namespace Ryujinx.HLE.Debugger
private Thread DebuggerThread;
private Thread MessageHandlerThread;
private bool _shuttingDown = false;
private ManualResetEventSlim _breakHandlerEvent = new ManualResetEventSlim(false);
private ulong? cThread;
private ulong? gThread;
@ -237,6 +238,7 @@ namespace Ryujinx.HLE.Debugger
case ThreadBreakMessage { Context: var ctx }:
DebugProcess.DebugStop();
gThread = cThread = ctx.ThreadUid;
_breakHandlerEvent.Set();
Reply($"T05thread:{ctx.ThreadUid:x};");
break;
@ -860,6 +862,9 @@ namespace Ryujinx.HLE.Debugger
}
catch (InvalidMemoryRegionException)
{
// InvalidAccessHandler will show an error message, we log it again to tell user the error is from GDB (which can be ignored)
// TODO: Do not let InvalidAccessHandler show the error message
Logger.Notice.Print(LogClass.GdbStub, $"GDB failed to read memory at 0x{addr:X16}");
ReplyError();
}
}
@ -1266,15 +1271,20 @@ namespace Ryujinx.HLE.Debugger
Messages.Add(new KillMessage());
MessageHandlerThread.Join();
Messages.Dispose();
_breakHandlerEvent.Dispose();
}
}
public void BreakHandler(IExecutionContext ctx, ulong address, int imm)
{
Logger.Notice.Print(LogClass.GdbStub, $"Break hit on thread {ctx.ThreadUid} at pc {address:x016}");
Messages.Add(new ThreadBreakMessage(ctx, address, imm));
DebugProcess.DebugInterruptHandler(ctx);
_breakHandlerEvent.Reset();
Messages.Add(new ThreadBreakMessage(ctx, address, imm));
// Messages.Add can block, so we log it after adding the message to make sure user can see the log at the same time GDB receives the break message
Logger.Notice.Print(LogClass.GdbStub, $"Break hit on thread {ctx.ThreadUid} at pc {address:x016}");
// Wait for the process to stop before returning to avoid BreakHander being called multiple times from the same breakpoint
_breakHandlerEvent.Wait(5000);
}
public void StepHandler(IExecutionContext ctx)