本文整理汇总了C#中CorFrame.GetILOffset方法的典型用法代码示例。如果您正苦于以下问题:C# CorFrame.GetILOffset方法的具体用法?C# CorFrame.GetILOffset怎么用?C# CorFrame.GetILOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CorFrame
的用法示例。
在下文中一共展示了CorFrame.GetILOffset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GoToIL
public static bool GoToIL(IModuleIdProvider moduleIdProvider, IDocumentTabService documentTabService, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
if (!CanGoToIL(frame))
return false;
var func = frame.Function;
if (func == null)
return false;
return DebugUtils.GoToIL(moduleIdProvider, documentTabService, moduleLoader.LoadModule(func.Module, canLoadDynFile: true, isAutoLoaded: true), frame.Token, frame.GetILOffset(moduleLoader), newTab);
}
示例2: GoToIL
public static bool GoToIL(IFileTabManager fileTabManager, IModuleLoader moduleLoader, CorFrame frame, bool newTab) {
if (!CanGoToIL(frame))
return false;
var func = frame.Function;
if (func == null)
return false;
return DebugUtils.GoToIL(fileTabManager, moduleLoader.LoadModule(func.Module, true), frame.Token, frame.GetILOffset(moduleLoader), newTab);
}
示例3: GoToIL
public static bool GoToIL(CorFrame frame, bool newTab) {
if (!CanGoToIL(frame))
return false;
var func = frame.Function;
if (func == null)
return false;
return DebugUtils.GoToIL(ModuleLoader.Instance.LoadModule(func.Module, true), frame.Token, frame.GetILOffset(), newTab);
}
示例4: GetCodeLocation
CodeLocation? GetCodeLocation(CorFrame frame)
{
if (ProcessState != DebuggerProcessState.Stopped)
return null;
if (frame == null)
return null;
var sma = frame.GetSerializedDnModuleWithAssembly();
if (sma == null)
return null;
uint token = frame.Token;
if (token == 0)
return null;
return new CodeLocation(sma.Value, token, frame.GetILOffset(), frame.ILFrameIP.Mapping);
}
示例5: GetStepRanges
StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto)
{
if (frame == null)
return null;
if (!frame.IsILFrame)
return null;
if (frame.ILFrameIP.IsUnmappedAddress)
return null;
var key = CreateMethodKey(debugger, frame);
if (key == null)
return null;
MemberMapping mapping;
var textView = MainWindow.Instance.SafeActiveTextView;
var cm = textView.CodeMappings;
if (cm == null || !cm.TryGetValue(key.Value, out mapping)) {
// User has decompiled some other code or switched to another tab
UpdateCurrentMethod();
JumpToCurrentStatement(textView);
// It could be cached and immediately available. Check again
cm = textView.CodeMappings;
if (cm == null || !cm.TryGetValue(key.Value, out mapping))
return null;
}
bool isMatch;
var scm = mapping.GetInstructionByOffset(frame.GetILOffset(), out isMatch);
uint[] ilRanges;
if (scm == null)
ilRanges = mapping.ToArray(null, false);
else
ilRanges = scm.ToArray(isMatch);
if (ilRanges.Length == 0)
return null;
return CreateStepRanges(ilRanges);
}
示例6: GetStepRanges
StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto) {
if (frame == null)
return null;
if (!frame.IsILFrame)
return null;
if (frame.ILFrameIP.IsUnmappedAddress)
return null;
var key = CreateMethodKey(debugger, frame);
if (key == null)
return null;
MethodDebugInfo info;
var tab = documentTabService.GetOrCreateActiveTab();
var documentViewer = tab.TryGetDocumentViewer();
var methodDebugService = documentViewer.GetMethodDebugService();
if ((info = methodDebugService.TryGetMethodDebugInfo(key.Value)) == null) {
// User has decompiled some other code or switched to another tab
UpdateCurrentMethod();
JumpToCurrentStatement(tab);
// It could be cached and immediately available. Check again
documentViewer = tab.TryGetDocumentViewer();
methodDebugService = documentViewer.GetMethodDebugService();
if ((info = methodDebugService.TryGetMethodDebugInfo(key.Value)) == null)
return null;
}
var sourceStatement = info.GetSourceStatementByCodeOffset(frame.GetILOffset(moduleLoader.Value));
uint[] ranges;
if (sourceStatement == null)
ranges = info.GetUnusedRanges();
else
ranges = info.GetRanges(sourceStatement.Value);
if (ranges.Length == 0)
return null;
return CreateStepRanges(ranges);
}
示例7: GetCodeLocation
CodeLocation? GetCodeLocation(CorFrame frame) {
if (ProcessState != DebuggerProcessState.Paused)
return null;
if (frame == null)
return null;
var func = frame.Function;
if (func == null)
return null;
return new CodeLocation(func, frame.GetILOffset(moduleLoader.Value), frame.ILFrameIP.Mapping);
}
示例8: GetStepRanges
StepRange[] GetStepRanges(DnDebugger debugger, CorFrame frame, bool isStepInto) {
if (frame == null)
return null;
if (!frame.IsILFrame)
return null;
if (frame.ILFrameIP.IsUnmappedAddress)
return null;
var key = CreateMethodKey(debugger, frame);
if (key == null)
return null;
MemberMapping mapping;
var tab = fileTabManager.GetOrCreateActiveTab();
var uiContext = tab.TryGetTextEditorUIContext();
var cm = uiContext.GetCodeMappings();
if ((mapping = cm.TryGetMapping(key.Value)) == null) {
// User has decompiled some other code or switched to another tab
UpdateCurrentMethod();
JumpToCurrentStatement(tab);
// It could be cached and immediately available. Check again
uiContext = tab.TryGetTextEditorUIContext();
cm = uiContext.GetCodeMappings();
if ((mapping = cm.TryGetMapping(key.Value)) == null)
return null;
}
bool isMatch;
var scm = mapping.GetInstructionByOffset(frame.GetILOffset(moduleLoader.Value), out isMatch);
uint[] ilRanges;
if (scm == null)
ilRanges = mapping.ToArray(null, false);
else
ilRanges = scm.ToArray(isMatch);
if (ilRanges.Length == 0)
return null;
return CreateStepRanges(ilRanges);
}