public AD7StackFrame(AD7Engine engine, AD7Thread thread, ThreadContext threadContext) { Debug.Assert(threadContext != null, "ThreadContext is null"); Engine = engine; Thread = thread; ThreadContext = threadContext; _textPosition = threadContext.TextPosition; _functionName = threadContext.Function; if (threadContext.pc.HasValue) { _codeCxt = new AD7MemoryAddress(this.Engine, threadContext.pc.Value, _functionName); } if (_textPosition != null) { _documentCxt = new AD7DocumentContext(_textPosition, _codeCxt); if (_codeCxt != null) { _codeCxt.SetDocumentContext(_documentCxt); } } }
public ThreadContext(ulong?addr, MITextPosition textPosition, string function, uint level, string from) { pc = addr; sp = 0; TextPosition = textPosition; Function = function; Level = level; From = from; }
internal BoundBreakpoint(PendingBreakpoint parent, TupleValue bindinfo) { // CLRDBG TODO: Support clr addresses for breakpoints this.Addr = bindinfo.TryFindAddr("addr") ?? 0; this.FunctionName = bindinfo.TryFindString("func"); this.HitCount = 0; _parent = parent; _textPosition = MITextPosition.TryParse(bindinfo); }
public ThreadContext(ulong? addr, MITextPosition textPosition, string function, uint level, string from) { pc = addr; sp = 0; TextPosition = textPosition; Function = function; Level = level; From = from; }
private ThreadContext CreateContext(TupleValue frame) { ulong? pc = frame.TryFindAddr("addr"); MITextPosition textPosition = MITextPosition.TryParse(this._debugger, frame); string func = frame.TryFindString("func"); uint level = frame.FindUint("level"); string from = frame.TryFindString("from"); return(new ThreadContext(pc, textPosition, func, level, from)); }
} // name as it appears in the debug symbols internal BoundBreakpoint(PendingBreakpoint parent, TupleValue bindinfo) { // CLRDBG TODO: Support clr addresses for breakpoints this.Addr = bindinfo.TryFindAddr("addr") ?? 0; this.FunctionName = bindinfo.TryFindString("func"); this.Enabled = bindinfo.TryFindString("enabled") == "n" ? false : true; this.HitCount = 0; this.CompiledFileName = bindinfo.Contains("fullname") ? bindinfo.FindString("fullname") : bindinfo.TryFindString("file"); _parent = parent; _textPosition = MITextPosition.TryParse(parent.DebuggedProcess, bindinfo); }
internal BoundBreakpoint(PendingBreakpoint parent, ulong addr, /*optional*/ TupleValue frame) { Addr = addr; HitCount = 0; _parent = parent; if (frame != null) { this.FunctionName = frame.TryFindString("func"); _textPosition = MITextPosition.TryParse(frame); } }
internal BoundBreakpoint(PendingBreakpoint parent, ulong addr, /*optional*/ TupleValue frame, string bkptno) { Addr = addr; HitCount = 0; Enabled = true; this.Number = bkptno; _parent = parent; if (frame != null) { this.FunctionName = frame.TryFindString("func"); _textPosition = MITextPosition.TryParse(parent.DebuggedProcess, frame); } }
// Enumerates the code contexts for a given position in a source file. public int EnumCodeContexts(IDebugDocumentPosition2 docPosition, out IEnumDebugCodeContexts2 ppEnum) { string documentName; EngineUtils.CheckOk(docPosition.GetFileName(out documentName)); // Get the location in the document TEXT_POSITION[] startPosition = new TEXT_POSITION[1]; TEXT_POSITION[] endPosition = new TEXT_POSITION[1]; EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition)); List <IDebugCodeContext2> codeContexts = new List <IDebugCodeContext2>(); List <ulong> addresses = null; uint line = startPosition[0].dwLine + 1; _debuggedProcess.WorkerThread.RunOperation(async() => { addresses = await DebuggedProcess.StartAddressesForLine(documentName, line); }); if (addresses != null && addresses.Count > 0) { foreach (var a in addresses) { var codeCxt = new AD7MemoryAddress(this, a, null); TEXT_POSITION pos; pos.dwLine = line; pos.dwColumn = 0; MITextPosition textPosition = new MITextPosition(documentName, pos, pos); codeCxt.SetDocumentContext(new AD7DocumentContext(textPosition, codeCxt, this.DebuggedProcess)); codeContexts.Add(codeCxt); } if (codeContexts.Count > 0) { ppEnum = new AD7CodeContextEnum(codeContexts.ToArray()); return(Constants.S_OK); } } ppEnum = null; return(Constants.E_FAIL); }
private ThreadContext CreateContext(TupleValue frame) { ulong?pc = frame.TryFindAddr("addr"); // don't report source line info for modules marked as IgnoreSource bool ignoreSource = false; if (pc != null) { var module = _debugger.FindModule(pc.Value); if (module != null && module.IgnoreSource) { ignoreSource = true; } } MITextPosition textPosition = !ignoreSource?MITextPosition.TryParse(this._debugger, frame) : null; string func = frame.TryFindString("func"); uint level = frame.FindUint("level"); string from = frame.TryFindString("from"); return(new ThreadContext(pc, textPosition, func, level, from)); }
public AD7StackFrame(AD7Engine engine, AD7Thread thread, Mono.Debugger.Soft.StackFrame threadContext) { Debug.Assert(threadContext != null, "ThreadContext is null"); Engine = engine; this.Thread = thread; this.ThreadContext = threadContext; _textPosition = RoslynHelper.GetStatementRange(ThreadContext.FileName, ThreadContext.LineNumber, ThreadContext.ColumnNumber); _functionName = threadContext.Method.Name; //if(threadContext.IsNativeTransition) //{ //} if (_textPosition != null) { docContext = new AD7DocumentContext(_textPosition); } this.LocalVariables = threadContext.GetVisibleVariables().Select(x => new MonoProperty(threadContext, x)).ToList(); }
public AD7DocumentContext(MITextPosition textPosition, AD7MemoryAddress codeContext, DebuggedProcess debuggedProcess) { _textPosition = textPosition; _codeContext = codeContext; _debuggedProcess = debuggedProcess; }
// Enumerates the code contexts for a given position in a source file. public int EnumCodeContexts(IDebugDocumentPosition2 docPosition, out IEnumDebugCodeContexts2 ppEnum) { string documentName; EngineUtils.CheckOk(docPosition.GetFileName(out documentName)); // Get the location in the document TEXT_POSITION[] startPosition = new TEXT_POSITION[1]; TEXT_POSITION[] endPosition = new TEXT_POSITION[1]; EngineUtils.CheckOk(docPosition.GetRange(startPosition, endPosition)); List<IDebugCodeContext2> codeContexts = new List<IDebugCodeContext2>(); List<ulong> addresses = null; uint line = startPosition[0].dwLine + 1; _debuggedProcess.WorkerThread.RunOperation(async () => { addresses = await DebuggedProcess.StartAddressesForLine(documentName, line); }); if (addresses != null && addresses.Count > 0) { foreach (var a in addresses) { var codeCxt = new AD7MemoryAddress(this, a, null); TEXT_POSITION pos; pos.dwLine = line; pos.dwColumn = 0; MITextPosition textPosition = new MITextPosition(documentName, pos, pos); codeCxt.SetDocumentContext(new AD7DocumentContext(textPosition, codeCxt, this.DebuggedProcess)); codeContexts.Add(codeCxt); } if (codeContexts.Count > 0) { ppEnum = new AD7CodeContextEnum(codeContexts.ToArray()); return Constants.S_OK; } } ppEnum = null; return Constants.E_FAIL; }
public AD7DocumentContext(MITextPosition textPosition, AD7MemoryAddress codeContext) { _textPosition = textPosition; _codeContext = codeContext; }