public bool CanNavigateTo(ILInstructionInfo instruction) { switch (instruction.OperandType) { case OperandType.InlineMethod: return(true); default: return(false); } }
private void RegisterJumpFromLine(ILInstructionInfo other) { if (other == this) { return; } if (jumpsFromOtherLines.Contains(other)) { return; } jumpsFromOtherLines.Add(other); }
private void RegisterJumpToLine(ILInstructionInfo other) { if (other == this) { return; } if (jumpsToOtherLines.Contains(other)) { return; } jumpsToOtherLines.Add(other); var instructionCode = this.instruction.Code.ToString().ToLowerInvariant(); this.IsConditionalBranch = instructionCode.Contains("true") || instructionCode.Contains("false"); this.Is_BrIfTrue = IsConditionalBranch && instructionCode.Contains("true"); }
public void TryNavigateTo(ILInstructionInfo instruction) { Debug.Log("CLICKED " + instruction.Line); switch (instruction.OperandType) { case OperandType.InlineMethod: if (instruction.Operand is MethodInfo method) { var type = method.ReflectedType; var methodName = method.GetSignature(false); Debug.Log(("TryNavigate to " + type?.FullName + " : " + methodName + "\n" + type?.AssemblyQualifiedName).I()); // selecting assembly is not just the namespace // like System.Collections.Generic is in System.Core Assembly -> so we would need a dictionary with all the types and their fullname // for all assemblies to really make sure we can navigate there var assemblyId = type?.Assembly.FullName; if (!SelectAssembly(assemblyId)) { Debug.Log("could not find assembly at " + assemblyId); return; } var typeId = type?.Namespace + "." + type?.Name; if (!SelectType(typeId)) { Debug.Log("Could not find type at " + typeId); return; } if (!SelectMethod(methodName)) { Debug.Log("Could not find method at " + methodName); return; } SaveNavigation(); } break; } }