本文整理汇总了C#中Mono.Debugger.Soft.ThreadMirror.GetFrames方法的典型用法代码示例。如果您正苦于以下问题:C# ThreadMirror.GetFrames方法的具体用法?C# ThreadMirror.GetFrames怎么用?C# ThreadMirror.GetFrames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Debugger.Soft.ThreadMirror
的用法示例。
在下文中一共展示了ThreadMirror.GetFrames方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SoftDebuggerBacktrace
public SoftDebuggerBacktrace (SoftDebuggerSession session, MDB.ThreadMirror thread): base (session.Adaptor)
{
this.session = session;
this.thread = thread;
stackVersion = session.StackVersion;
if (thread != null)
this.frames = thread.GetFrames ();
else
this.frames = new MDB.StackFrame[0];
}
示例2: EvaluateExpression
string EvaluateExpression (ThreadMirror thread, string exp)
{
try {
MDB.StackFrame[] frames = thread.GetFrames ();
if (frames.Length == 0)
return string.Empty;
EvaluationOptions ops = Options.EvaluationOptions;
ops.AllowTargetInvoke = true;
SoftEvaluationContext ctx = new SoftEvaluationContext (this, frames[0], ops);
ValueReference val = ctx.Evaluator.Evaluate (ctx, exp);
return val.CreateObjectValue (false).Value;
} catch (Exception ex) {
OnDebuggerOutput (true, ex.ToString ());
return string.Empty;
}
}
示例3: DoWalkStackFrames
private void DoWalkStackFrames(ThreadMirror thread, Trace parent)
{
Mono.Debugger.Soft.StackFrame[] frames = thread.GetFrames();
for (int i = frames.Length - 1; i >= 0; --i) // go backwards so that the frames at the top of the stack appear first
{
var frame = frames[i];
string name;
if (string.IsNullOrEmpty(frame.FileName))
name = string.Format("method {0}.{1}", frame.Method.DeclaringType.FullName, frame.Method.Name);
else
name = string.Format("method {0}.{1} [{2}:{3}]", frame.Method.DeclaringType.FullName, frame.Method.Name, frame.FileName, frame.LineNumber);
Log.WriteLine(TraceLevel.Info, "TraceRoots", name);
Log.Indent();
var child = new Trace(name, string.Empty, frame);
DoWalkStackFrame(frame, child);
if (child.Children.Count > 0)
parent.Children.Add(child);
Log.Unindent();
}
}