Exemple #1
0
 /// <summary>Initializes a new instance of the <see cref="Disassembler"/> class.</summary>
 /// <param name="triple">Triple for the instruction set to disassemble</param>
 /// <param name="disInfo">Context value passed to <paramref name="infoCallBack"/></param>
 /// <param name="tagType">TODO:Explain this...</param>
 /// <param name="infoCallBack">Op info callback</param>
 /// <param name="symbolLookup">Symbol lookup delegate</param>
 public Disassembler(Triple triple
                     , IntPtr disInfo
                     , int tagType
                     , LLVMOpInfoCallback infoCallBack
                     , LLVMSymbolLookupCallback symbolLookup
                     )
 {
     InfoCallBack         = infoCallBack;
     SymbolLookupCallback = symbolLookup;
     DisasmHandle         = LLVMCreateDisasm(triple.ToString( ), disInfo, tagType, InfoCallBack, SymbolLookupCallback);
 }
Exemple #2
0
        public static DisasmContext CreateDisasmCPUFeatures(string triple, string cpu, string features, IntPtr disInfo,
                                                            int tagType, LLVMOpInfoCallback opInfoCallback,
                                                            LLVMSymbolLookupCallback symbolCallback)
        {
            var disasmContext = LLVM.CreateDisasmCPUFeatures(triple, cpu, features, disInfo, tagType, opInfoCallback, symbolCallback)
                                .Wrap()
                                .MakeHandleOwner <DisasmContext, LLVMDisasmContextRef>();

            disasmContext._opInfoCallback       = opInfoCallback;
            disasmContext._symbolLookupCallback = symbolCallback;
            return(disasmContext);
        }
Exemple #3
0
        public static DisasmContext CreateDisasm(string tripleName, IntPtr disInfo, int tagType, OpInfoCallback getOpInfo,
                                                 SymbolLookupCallback symbolLookUp)
        {
            var opInfoCallback = new LLVMOpInfoCallback(getOpInfo);
            var symbolCallback = new LLVMSymbolLookupCallback(new SymbolLookupClosure(symbolLookUp).Invoke);
            var disasmContext  =
                LLVM.CreateDisasm(tripleName, disInfo, tagType, opInfoCallback, symbolCallback)
                .Wrap()
                .MakeHandleOwner <DisasmContext, LLVMDisasmContextRef>();

            disasmContext._opInfoCallback = opInfoCallback;
            return(disasmContext);
        }
 /// <summary>Initializes a new instance of the <see cref="Disassembler"/> class.</summary>
 /// <param name="triple">Triple for the instruction set to disassemble</param>
 /// <param name="cpu">CPU string for the instruction set</param>
 /// <param name="disInfo">Context value passed to <paramref name="infoCallBack"/></param>
 /// <param name="tagType">TODO:Explain this...</param>
 /// <param name="infoCallBack">Op info callback</param>
 /// <param name="symbolLookup">Symbol lookup delegate</param>
 public Disassembler(Triple triple
                     , string cpu
                     , IntPtr disInfo
                     , int tagType
                     , LLVMOpInfoCallback infoCallBack
                     , LLVMSymbolLookupCallback symbolLookup
                     )
 {
     triple.ValidateNotNull(nameof(triple));
     InfoCallBack         = infoCallBack;
     SymbolLookupCallback = symbolLookup;
     DisasmHandle         = LLVMCreateDisasmCPU(triple.ToString( ), cpu, disInfo, tagType, InfoCallBack, SymbolLookupCallback);
 }
Exemple #5
0
 public static extern LLVMDisasmContextRef CreateDisasmCPUFeatures([MarshalAs(UnmanagedType.LPStr)] string @Triple, [MarshalAs(UnmanagedType.LPStr)] string @CPU, [MarshalAs(UnmanagedType.LPStr)] string @Features, IntPtr @DisInfo, int @TagType, LLVMOpInfoCallback @GetOpInfo, LLVMSymbolLookupCallback @SymbolLookUp);
Exemple #6
0
 private static extern IntPtr LLVMCreateDisasmCPU(string tripleName, string cpu, IntPtr disInfo, int tagType, LLVMOpInfoCallback getOpInfo, LLVMSymbolLookupCallback symbolLookUp);
Exemple #7
0
 private static extern IntPtr LLVMCreateDisasmCPU(string tripleName, string cpu, IntPtr disInfo, int tagType, LLVMOpInfoCallback getOpInfo, LLVMSymbolLookupCallback symbolLookUp);