mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-08 06:15:48 +00:00
gdb: more cleanups
- convert GdbRegisters utilities into extensions on IExecutionContext - add a Write/Read Register helper on Debugger that handles 32/64 bit instead of doing that for every usage of register reading/writing
This commit is contained in:
@@ -112,15 +112,22 @@ namespace Ryujinx.HLE.Debugger
|
||||
}
|
||||
}
|
||||
|
||||
internal bool WriteRegister(IExecutionContext ctx, int gdbRegId, StringStream ss) =>
|
||||
IsProcess32Bit
|
||||
? ctx.WriteRegister32(gdbRegId, ss)
|
||||
: ctx.WriteRegister64(gdbRegId, ss);
|
||||
|
||||
internal string ReadRegister(IExecutionContext ctx, int gdbRegId) =>
|
||||
IsProcess32Bit
|
||||
? ctx.ReadRegister32(gdbRegId)
|
||||
: ctx.ReadRegister64(gdbRegId);
|
||||
|
||||
public string GetStackTrace()
|
||||
{
|
||||
if (GThread == null)
|
||||
return "No thread selected\n";
|
||||
|
||||
if (Process == null)
|
||||
return "No application process found\n";
|
||||
|
||||
return Process.Debugger.GetGuestStackTrace(DebugProcess.GetThread(GThread.Value));
|
||||
return Process?.Debugger?.GetGuestStackTrace(DebugProcess.GetThread(GThread.Value)) ?? "No application process found\n";
|
||||
}
|
||||
|
||||
public string GetRegisters()
|
||||
@@ -128,10 +135,7 @@ namespace Ryujinx.HLE.Debugger
|
||||
if (GThread == null)
|
||||
return "No thread selected\n";
|
||||
|
||||
if (Process == null)
|
||||
return "No application process found\n";
|
||||
|
||||
return Process.Debugger.GetCpuRegisterPrintout(DebugProcess.GetThread(GThread.Value));
|
||||
return Process?.Debugger?.GetCpuRegisterPrintout(DebugProcess.GetThread(GThread.Value)) ?? "No application process found\n";
|
||||
}
|
||||
|
||||
public string GetMinidump()
|
||||
|
||||
Reference in New Issue
Block a user