mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 06:46:24 +02:00
gdb: Support precise tracking of PC value when GDB Stub is enabled
This commit is contained in:
parent
009d319bc2
commit
838296ccb6
3 changed files with 43 additions and 0 deletions
|
@ -22,6 +22,11 @@ namespace ARMeilleure.State
|
|||
public ulong ExclusiveValueHigh;
|
||||
public int Running;
|
||||
public long Tpidr2El0;
|
||||
|
||||
/// <summary>
|
||||
/// This is only set when Optimizations.EnableDebugging is true.
|
||||
/// </summary>
|
||||
public ulong CurrentPc;
|
||||
}
|
||||
|
||||
private static NativeCtxStorage _dummyStorage = new();
|
||||
|
@ -39,6 +44,11 @@ namespace ARMeilleure.State
|
|||
|
||||
public ulong GetPc()
|
||||
{
|
||||
if (Optimizations.EnableDebugging)
|
||||
{
|
||||
return GetStorage().CurrentPc;
|
||||
}
|
||||
|
||||
// TODO: More precise tracking of PC value.
|
||||
return GetStorage().DispatchAddress;
|
||||
}
|
||||
|
@ -268,6 +278,11 @@ namespace ARMeilleure.State
|
|||
return StorageOffset(ref _dummyStorage, ref _dummyStorage.Running);
|
||||
}
|
||||
|
||||
public static int GetCurrentPcOffset()
|
||||
{
|
||||
return StorageOffset(ref _dummyStorage, ref _dummyStorage.CurrentPc);
|
||||
}
|
||||
|
||||
private static int StorageOffset<T>(ref NativeCtxStorage storage, ref T target)
|
||||
{
|
||||
return (int)Unsafe.ByteOffset(ref Unsafe.As<NativeCtxStorage, T>(ref storage), ref target);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue