Improve IRDumper (#1135)
* Improve IRDumper * Make Symbols.Add(ulong, ulong, ulong, string) thread safe * Use a StringBuilder for MemoryOperand * Add #if M_DEBUG guards * Fix JMP_TABLE typo * Fix using in Symbols * Use Conditional("M_DEBUG") instead Address gdkchan's feedback * Use a struct instead of 4-tuple Address gdkchan's feedback * Place symbols in comments instead Address gdkchan's feedback * Use StringBuilder throughout * Handle offsetted symbols * Fix naming convention of Builder * Avoid ArgumentException * Remove unnecessary using * Use switch expression instead * Turn into a class * Clean up * Remove unnecessary using
This commit is contained in:
parent
53369e79bd
commit
180ad8605d
4 changed files with 333 additions and 128 deletions
|
@ -1,3 +1,4 @@
|
|||
using ARMeilleure.Diagnostics;
|
||||
using ARMeilleure.IntermediateRepresentation;
|
||||
using ARMeilleure.State;
|
||||
using System;
|
||||
|
@ -85,6 +86,8 @@ namespace ARMeilleure.Translation
|
|||
|
||||
IntPtr ptr = Marshal.GetFunctionPointerForDelegate<Delegate>(func);
|
||||
|
||||
Symbols.Add((ulong)ptr.ToInt64(), func.Method.Name);
|
||||
|
||||
OperandType returnType = GetOperandType(func.Method.ReturnType);
|
||||
|
||||
return Call(Const(ptr.ToInt64()), returnType, callArgs);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using ARMeilleure.Memory;
|
||||
using ARMeilleure.Diagnostics;
|
||||
using ARMeilleure.Memory;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
@ -60,6 +61,9 @@ namespace ARMeilleure.Translation
|
|||
|
||||
_targets = new ConcurrentDictionary<ulong, TranslatedFunction>();
|
||||
_dependants = new ConcurrentDictionary<ulong, LinkedList<int>>();
|
||||
|
||||
Symbols.Add((ulong)_jumpRegion.Pointer.ToInt64(), JumpTableByteSize, JumpTableStride, "JMP_TABLE");
|
||||
Symbols.Add((ulong)_dynamicRegion.Pointer.ToInt64(), DynamicTableByteSize, DynamicTableStride, "DYN_TABLE");
|
||||
}
|
||||
|
||||
public void RegisterFunction(ulong address, TranslatedFunction func)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue