void compute_source() { lock (this) { if (has_source) { return; } has_source = true; if ((method == null) || !method.HasSource || !method.HasLineNumbers) { return; } source = method.LineNumberTable.Lookup(address); if (source == null) { return; } if (method.MethodSource.IsDynamic) { return; } location = new SourceLocation( method.MethodSource, source.SourceFile, source.Row); } }
internal StackFrame(Thread thread, FrameType type, TargetAddress address, TargetAddress stack_ptr, TargetAddress frame_address, Registers registers, Method method, SourceAddress source) : this(thread, type, address, stack_ptr, frame_address, registers, method) { this.source = source; if (method.HasSource && !method.MethodSource.IsDynamic) { location = new SourceLocation( method.MethodSource, source.SourceFile, source.Row); } has_source = true; }
protected override bool DoResolve(ScriptingContext context) { int line = -1; int pos = Argument.IndexOf (':'); if (pos >= 0) { string filename = Argument.Substring (0, pos); try { line = (int) UInt32.Parse (Argument.Substring (pos+1)); } catch { throw new ScriptingException ("Expected filename:line"); } return FindFile (context, filename, line); } if (Argument == "") { StackFrame frame = context.CurrentFrame; if (frame.SourceAddress == null) return false; if (frame.SourceLocation != null) location = frame.SourceLocation; else address = frame.SourceAddress; return true; } try { line = (int) UInt32.Parse (Argument); } catch { } if (line != -1) { location = context.CurrentLocation; if (location.FileName == null) throw new ScriptingException ( "Location doesn't have any source code."); return FindFile (context, location.FileName, line); } MethodExpression mexpr; try { Expression expr = ParseExpression (context); if (expr == null) return false; mexpr = expr.ResolveMethod (context, type); } catch { mexpr = null; } if (mexpr != null) { TargetFunctionType func; try { func = mexpr.EvaluateMethod (context, type, null); } catch { func = null; } if (func != null) method = func.GetSourceCode (); location = mexpr.EvaluateSource (context); } else location = context.FindMethod (Argument); if (location == null) throw new ScriptingException ( "Location doesn't have any source code."); return true; }
void compute_source() { lock (this) { if (has_source) return; has_source = true; if ((method == null) || !method.HasSource || !method.HasLineNumbers) return; source = method.LineNumberTable.Lookup (address); if (source == null) return; if (method.MethodSource.IsDynamic) return; location = new SourceLocation ( method.MethodSource, source.SourceFile, source.Row); } }
internal StackFrame(Thread thread, FrameType type, TargetAddress address, TargetAddress stack_ptr, TargetAddress frame_address, Registers registers, Method method, SourceAddress source) : this(thread, type, address, stack_ptr, frame_address, registers, method) { this.source = source; if (method.HasSource && !method.MethodSource.IsDynamic) location = new SourceLocation ( method.MethodSource, source.SourceFile, source.Row); has_source = true; }