本文整理汇总了C#中Mono.Debugger.Soft.TypeMirror.GetMethodsByNameFlags方法的典型用法代码示例。如果您正苦于以下问题:C# TypeMirror.GetMethodsByNameFlags方法的具体用法?C# TypeMirror.GetMethodsByNameFlags怎么用?C# TypeMirror.GetMethodsByNameFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Debugger.Soft.TypeMirror
的用法示例。
在下文中一共展示了TypeMirror.GetMethodsByNameFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveBreakpoints
void ResolveBreakpoints (TypeMirror type)
{
var resolved = new List<BreakInfo> ();
string typeName = type.FullName;
Location loc;
ProcessType (type);
// First, resolve FunctionBreakpoints
foreach (var bi in pending_bes.Where (b => b.BreakEvent is FunctionBreakpoint)) {
var bp = (FunctionBreakpoint) bi.BreakEvent;
int dot = bp.FunctionName.LastIndexOf ('.');
string ftypeName = bp.FunctionName.Substring (0, dot);
if (ftypeName == typeName) {
string methodName = bp.FunctionName.Substring (dot + 1);
foreach (var method in type.GetMethodsByNameFlags (methodName, BindingFlags.Default, false)) {
if (!CheckMethodParams (method, bp.ParamTypes))
continue;
loc = GetLocFromMethod (method);
if (loc != null) {
string paramList = bp.ParamTypes != null ? "(" + string.Join (",", bp.ParamTypes) + ")" : "";
OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint for '{0}{1}' to {2}:{3} [0x{4:x5}].\n",
bp.FunctionName, paramList, loc.SourceFile, loc.LineNumber, loc.ILOffset));
if (bp.ParamTypes == null)
bp.ParamTypes = GetParamTypes (method);
bp.SetResolvedFileName (loc.SourceFile);
ResolvePendingBreakpoint (bi, loc);
// Note: if the type or method is generic, there may be more instances so don't assume we are done resolving the breakpoint
if (!type.IsGenericType && !IsGenericMethod (method))
resolved.Add (bi);
break;
}
}
}
}
foreach (var be in resolved)
pending_bes.Remove (be);
resolved.Clear ();
// Now resolve normal Breakpoints
foreach (string s in type_to_source [type]) {
foreach (var bi in pending_bes.Where (b => b.BreakEvent is Breakpoint)) {
var bp = (Breakpoint) bi.BreakEvent;
if (PathsAreEqual (PathToFileName (bp.FileName), s)) {
bool insideLoadedRange;
bool genericMethod;
loc = GetLocFromType (type, s, bp.Line, out genericMethod, out insideLoadedRange);
if (loc != null) {
OnDebuggerOutput (false, string.Format ("Resolved pending breakpoint at '{0}:{1}' to {2} [0x{3:x5}].\n",
s, bp.Line, loc.Method.FullName, loc.ILOffset));
ResolvePendingBreakpoint (bi, loc);
// Note: if the type or method is generic, there may be more instances so don't assume we are done resolving the breakpoint
if (!genericMethod && !type.IsGenericType)
resolved.Add (bi);
} else {
if (insideLoadedRange) {
bi.SetStatus (BreakEventStatus.Invalid, null);
}
}
}
}
foreach (var be in resolved)
pending_bes.Remove (be);
resolved.Clear ();
}
// Thirdly, resolve pending catchpoints
foreach (var bi in pending_bes.Where (b => b.BreakEvent is Catchpoint)) {
var cp = (Catchpoint) bi.BreakEvent;
if (cp.ExceptionName == typeName) {
ResolvePendingCatchpoint (bi, type);
resolved.Add (bi);
}
}
foreach (var be in resolved)
pending_bes.Remove (be);
}