本文整理汇总了C#中Mono.Debugging.Client.DebuggerSession类的典型用法代码示例。如果您正苦于以下问题:C# DebuggerSession类的具体用法?C# DebuggerSession怎么用?C# DebuggerSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DebuggerSession类属于Mono.Debugging.Client命名空间,在下文中一共展示了DebuggerSession类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttachSession
internal void AttachSession (DebuggerSession s, BreakEvent ev)
{
session = s;
BreakEvent = ev;
session.NotifyBreakEventStatusChanged (BreakEvent);
if (adjustedLine != -1)
session.AdjustBreakpointLocation ((Breakpoint)BreakEvent, adjustedLine);
}
示例2: Attach
internal void Attach (DebuggerSession session)
{
this.session = session;
if (frames != null) {
foreach (StackFrame f in frames)
f.Attach (session);
}
}
示例3: Attach
internal void Attach (DebuggerSession session)
{
this.session = session;
if (currentThreads != null) {
foreach (ThreadInfo t in currentThreads)
t.Attach (session);
}
}
示例4: DebugAsyncOperation
public DebugAsyncOperation (DebuggerSession session)
{
this.session = session;
taskSource = new TaskCompletionSource<int> ();
DebuggingService.StoppedEvent += OnStopDebug;
CancellationTokenSource = new CancellationTokenSource ();
CancellationTokenSource.Token.Register (DebuggingService.Stop);
Task = taskSource.Task;
}
示例5: Attach
internal void Attach (DebuggerSession session)
{
this.session = session;
serverBacktrace = session.WrapDebuggerObject (serverBacktrace);
if (frames != null) {
foreach (StackFrame f in frames) {
f.Attach (session);
f.SourceBacktrace = serverBacktrace;
}
}
}
示例6: Attach
internal void Attach(DebuggerSession debugSession)
{
session = debugSession;
}
示例7: Resolve
string Resolve (DebuggerSession session, SourceLocation location, string exp, bool tryTypeOf)
{
exp = exp.TrimStart ();
if (exp.StartsWith ("?"))
return "?" + Resolve (session, location, exp.Substring (1).Trim ());
if (exp.StartsWith ("var "))
return "var " + Resolve (session, location, exp.Substring (4).Trim (' ','\t'));
exp = ReplaceExceptionTag (exp, session.Options.EvaluationOptions.CurrentExceptionTag);
StringReader codeStream = new StringReader (exp);
IParser parser = ParserFactory.CreateParser (SupportedLanguage.CSharp, codeStream);
Expression expObj = parser.ParseExpression ();
if (expObj == null)
return exp;
NRefactoryResolverVisitor ev = new NRefactoryResolverVisitor (session, location, exp);
expObj.AcceptVisitor (ev, null);
string r = ev.GetResolvedExpression ();
if (r == exp && !tryTypeOf && (expObj is BinaryOperatorExpression) && IsTypeName (exp)) {
// This is a hack to be able to parse expressions such as "List<string>". The NRefactory parser
// can parse a single type name, so a solution is to wrap it around a typeof(). We do it if
// the evaluation fails.
string res = Resolve (session, location, "typeof(" + exp + ")", true);
return res.Substring (7, res.Length - 8);
}
return r;
}
示例8: NRefactoryExpressionResolverVisitor
public NRefactoryExpressionResolverVisitor(DebuggerSession session, SourceLocation location, string expression)
{
this.expression = expression.Replace ("\n", "").Replace ("\r", "");
this.session = session;
this.location = location;
}
示例9: AppendThreads
void AppendThreads (TreeIter iter, ProcessInfo process, DebuggerSession session)
{
var threads = process.GetThreads ();
Array.Sort (threads, (ThreadInfo t1, ThreadInfo t2) => t1.Id.CompareTo (t2.Id));
session.FetchFrames (threads);
var activeThread = session.ActiveThread;
foreach (var thread in threads) {
var name = thread.Name == null && thread.Id == 1 ? GettextCatalog.GetString ("Main Thread") : thread.Name;
var weight = thread == activeThread ? Pango.Weight.Bold : Pango.Weight.Normal;
var icon = thread == activeThread ? Gtk.Stock.GoForward : null;
if (iter.Equals (TreeIter.Zero))
store.AppendValues (icon, thread.Id.ToString (), name, thread, (int)weight, thread.Location, session);
else
store.AppendValues (iter, icon, thread.Id.ToString (), name, thread, (int)weight, thread.Location, session);
}
}
示例10: Cleanup
static void Cleanup ()
{
currentBacktrace = null;
if (!IsDebugging)
return;
if (busyStatusIcon != null) {
busyStatusIcon.Dispose ();
busyStatusIcon = null;
}
session.TargetEvent -= OnTargetEvent;
session.TargetStarted -= OnStarted;
session.OutputWriter = null;
session.LogWriter = null;
session.ExceptionHandler = null;
session.BusyStateChanged -= OnBusyStateChanged;
session.TypeResolverHandler = null;
session.BreakpointTraceHandler = null;
session.GetExpressionEvaluator = null;
console.CancelRequested -= OnCancelRequested;
// Dispose the session at the end, since it may take a while.
DebuggerSession oldSession = session;
session = null;
if (StoppedEvent != null)
StoppedEvent (null, new EventArgs ());
if (console != null) {
console.Dispose ();
console = null;
}
DispatchService.GuiDispatch (delegate {
NotifyCallStackChanged ();
NotifyCurrentFrameChanged ();
NotifyLocationChanged ();
});
if (oldSession != null) {
oldSession.BusyStateChanged -= OnBusyStateChanged;
oldSession.Dispose ();
}
}
示例11: InternalDebuggerSession
public InternalDebuggerSession (DebuggerSession session)
{
this.session = session;
}
示例12:
void IRawObject.Connect(DebuggerSession session, EvaluationOptions options)
{
source = session.WrapDebuggerObject (source);
}
示例13: FillWithSource
public void FillWithSource ()
{
cachedLines.Clear ();
StackFrame sf = DebuggingService.CurrentFrame;
session = sf.DebuggerSession;
if (currentFile != sf.SourceLocation.FileName) {
AssemblyLine[] asmLines = sf.DebuggerSession.DisassembleFile (sf.SourceLocation.FileName);
if (asmLines == null) {
// Mixed disassemble not supported
Fill ();
return;
}
currentFile = sf.SourceLocation.FileName;
addressLines.Clear ();
editor.Text = string.Empty;
using (var sr = new StreamReader (sf.SourceLocation.FileName)) {
string line;
int sourceLine = 1;
int na = 0;
int editorLine = 1;
var sb = new StringBuilder ();
var asmLineNums = new List<int> ();
while ((line = sr.ReadLine ()) != null) {
InsertSourceLine (sb, editorLine++, line);
while (na < asmLines.Length && asmLines [na].SourceLine == sourceLine) {
asmLineNums.Add (editorLine);
InsertAssemblerLine (sb, editorLine++, asmLines [na++]);
}
sourceLine++;
}
editor.Text = sb.ToString ();
foreach (int li in asmLineNums)
editor.AddMarker (li, asmMarker);
}
}
int aline;
if (!addressLines.TryGetValue (GetAddrId (sf.Address, sf.AddressSpace), out aline))
return;
UpdateCurrentLineMarker (true);
}
示例14: SetUp
public override void SetUp ()
{
base.SetUp ();
ds = Start ("TestEvaluation");
if (ds == null)
Assert.Ignore ("Engine not found: {0}", EngineId);
frame = ds.ActiveThread.Backtrace.GetFrame (0);
}
示例15: Cleanup
public void Cleanup ()
{
if (taskSource != null) {
taskSource.SetResult (0);
taskSource = null;
}
DebuggingService.StoppedEvent -= OnStopDebug;
session = null;
}