private void HandleCompositeCommand(JdwpPacket packet) { var data = packet.Data; var suspendPolicy = (Jdwp.SuspendPolicy) data.GetByte(); var count = data.GetInt(); for (var i = 0; i < count; i++) { var eventKind = (Jdwp.EventKind) data.GetByte(); JdwpEvent evt; switch (eventKind) { case Jdwp.EventKind.VmInit: evt = new VmStart(data); break; case Jdwp.EventKind.SingleStep: evt = new SingleStep(data); break; case Jdwp.EventKind.BreakPoint: evt = new Breakpoint(data); break; case Jdwp.EventKind.MethodEntry: evt = new MethodEntry(data); break; case Jdwp.EventKind.MethodExit: evt = new MethodExit(data); break; case Jdwp.EventKind.Exception: evt = new Exception(data); break; case Jdwp.EventKind.ThreadStart: evt = new ThreadStart(data); break; case Jdwp.EventKind.ThreadEnd: evt = new ThreadDeath(data); break; case Jdwp.EventKind.ClassPrepare: evt = new ClassPrepare(data); break; case Jdwp.EventKind.ClassUnload: evt = new ClassUnload(data); break; case Jdwp.EventKind.FieldAccess: evt = new FieldAccess(data); break; case Jdwp.EventKind.FieldModification: evt = new FieldModification(data); break; case Jdwp.EventKind.VmDeath: evt = new VmDeath(data); break; default: throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind); } DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt); Task.Factory.StartNew(() => { evt.Accept(compositeCommandProcessor, suspendPolicy); }); } }
public Task <Entry> InvokeMethod(long resourceId, MethodEntry method) { return(WcfClient.InvokeMethodAsync(resourceId, method)); }
public string FormatMethodEntry(int threadId, int level, int lineNo, MethodEntry logEntry, ILogFilters filters, bool displayEnabled) { // entry details are merged with exit details return(_delayedService.HandleMethodEntry(logEntry, displayEnabled)); }
private void LogMethod(MethodBase method, MethodEntry entryType) { var @params = method.GetParameters(); var strMethod = string.Format("{0}({1})", method.Name, string.Join(", ", @params.Select(info => info.ParameterType.Name + " " + info.Name))); var name = Plugin != null ? Plugin.Name : "??? UNINITIALIZED ???"; Logger.DebugFormat("ProgressProvider for \"{0}\" plugin - {1} {2} method", name, entryType, strMethod); }
/// <summary> /// Create custom breakpoint. /// </summary> protected override DalvikLocationBreakpoint CreateLocationBreakpoint(SourceCodePosition sourcePosition, TypeEntry typeEntry, MethodEntry methodEntry, object data) { return(new DebugLocationBreakpoint(Jdwp.EventKind.BreakPoint, sourcePosition, typeEntry, methodEntry, (BreakpointBookmark)data)); }
public override void InvokeMethod(object fixture, MethodEntry testMethod) { testMethod.Invoke(fixture); }
public LogEntryTracker(int level, MethodEntry relatedEntry, String formattedLine) { this.Level = level; this.RelatedEntry = relatedEntry; this.FormattedLine = formattedLine; }
void ReadLineNumbers(MethodEntry entry, InstructionMapper mapper) { Document document = null; var table = entry.GetLineNumberTable (); foreach (var line in table.LineNumbers) { var instruction = mapper (line.Offset); if (instruction == null) continue; if (document == null) document = GetDocument (entry.CompileUnit.SourceFile); instruction.SequencePoint = LineToSequencePoint (line, entry, document); } }
void ReadLineNumbers(MethodEntry entry, MethodSymbols symbols) { var table = entry.GetLineNumberTable (); var lines = table.LineNumbers; var instructions = symbols.instructions = new Collection<InstructionSymbol> (lines.Length); for (int i = 0; i < lines.Length; i++) { var line = lines [i]; instructions.Add (new InstructionSymbol ( line.Offset, LineToSequencePoint (line, entry, GetDocument (entry.CompileUnit.SourceFile)))); } }
static void ReadLocalVariables(MethodEntry entry, MethodSymbols symbols) { foreach (var local in entry.GetLocals ()) { if (local.Index < 0 || local.Index >= symbols.Variables.Count) // Mono 2.6 emits wrong local infos for iterators continue; var variable = symbols.Variables [local.Index]; variable.Name = local.Name; } }
static Scope[] ReadScopes(MethodEntry entry, MethodBody body, InstructionMapper mapper) { var blocks = entry.GetCodeBlocks (); var scopes = new Scope [blocks.Length]; foreach (var block in blocks) { if (block.BlockType != CodeBlockEntry.Type.Lexical) continue; var scope = new Scope (); scope.Start = mapper (block.StartOffset); scope.End = mapper (block.EndOffset); scopes [block.Index] = scope; if (body.Scope == null) body.Scope = scope; if (!AddScope (body.Scope, scope)) body.Scope = scope; } return scopes; }
static void ReadLocalVariables(MethodEntry entry, MethodBody body, Scope [] scopes) { var locals = entry.GetLocals (); foreach (var local in locals) { if (local.Index < 0 || local.Index >= body.Variables.Count) // Mono 2.6 emits wrong local infos for iterators continue; var variable = body.Variables [local.Index]; variable.Name = local.Name; var index = local.BlockIndex; if (index < 0 || index >= scopes.Length) continue; var scope = scopes [index]; if (scope == null) continue; scope.Variables.Add (variable); } }
void read_methods() { lock (this) { if (method_token_hash != null) return; method_token_hash = new Dictionary<int, MethodEntry> (); method_list = new List<MethodEntry> (); long old_pos = reader.BaseStream.Position; reader.BaseStream.Position = ot.MethodTableOffset; for (int i = 0; i < MethodCount; i++) { MethodEntry entry = new MethodEntry (this, reader, i + 1); method_token_hash.Add (entry.Token, entry); method_list.Add (entry); } reader.BaseStream.Position = old_pos; } }
public MethodEntry DefineMethod(CompileUnitEntry comp_unit, int token, ScopeVariable[] scope_vars, LocalVariableEntry[] locals, LineNumberEntry[] lines, CodeBlockEntry[] code_blocks, string real_name, MethodEntry.Flags flags, int namespace_id) { if (reader != null) throw new InvalidOperationException (); MethodEntry method = new MethodEntry ( this, comp_unit, token, scope_vars, locals, lines, code_blocks, real_name, flags, namespace_id); AddMethod (method); return method; }
public void PrintLineNumberTables() { Message("Reading {0}, version {1}.{2}.", File.FileName, File.MajorVersion, File.MinorVersion); for (int i = 0; i < File.MethodCount; i++) { if (LineNumberTables.Count > 0) { if (!LineNumberTables.ContainsKey(i + 1)) { continue; } } MethodEntry method = File.GetMethod(i + 1); if (method == null) { throw new MonoSymbolFileException("Cannot get method {0}.", i + 1); } Cecil.MethodDefinition mdef = (Cecil.MethodDefinition)Assembly.MainModule.LookupToken( new Cecil.MetadataToken(Cecil.TokenType.Method, method.Token & 0xffffff)); if ((mdef == null) || (mdef.Body == null)) { throw new MonoSymbolFileException("Method {0} (token {1:x}) not found in assembly.", method.Index, method.Token); } string name = String.Format("{0} ({1})", method.Index, GetMethodName(mdef)); Message("Method {0} - {1}", method.Index, GetMethodName(mdef)); LineNumberTable lnt = method.GetLineNumberTable(); if (lnt == null) { throw new MonoSymbolFileException("Cannot get LNT from method {0}.", name); } if (lnt.LineNumbers == null) { throw new MonoSymbolFileException("Cannot get LNT from method {0}.", name); } Dictionary <int, bool> seen_files = new Dictionary <int, bool> (); LineNumberEntry start, end; if (lnt.GetMethodBounds(out start, out end)) { Message(" Bounds: {0} {1}", start, end); } foreach (LineNumberEntry line in lnt.LineNumbers) { if (!line.IsHidden && !seen_files.ContainsKey(line.File)) { SourceFileEntry file = File.GetSourceFile(line.File); Message(" File {0}{2}: {1}", file.Index, file.FileName, file.AutoGenerated ? " (auto-generated)" : ""); seen_files.Add(line.File, true); } string range = ""; if (line.SourceRange != null) { SourceRangeEntry sre = (SourceRangeEntry)line.SourceRange; range = String.Format(" - {0} {1} {2} {3}", sre.StartLine, sre.EndLine, sre.StartColumn, sre.EndColumn); } Message(" Line {0}:{1}:{2:x}{3}{4}", line.File, line.Row, line.Offset, line.IsHidden ? " (hidden)" : "", range); } } }
static SequencePoint LineToSequencePoint(LineNumberEntry line, MethodEntry entry, Document document) { return new SequencePoint (document) { StartLine = line.Row, EndLine = line.EndRow, StartColumn = line.Column, EndColumn = line.EndColumn, }; }
/// <summary> /// Default ctor /// </summary> public DebugLocationBreakpoint(Jdwp.EventKind eventKind, SourceCodePosition sourcePosition, TypeEntry typeEntry, MethodEntry methodEntry, BreakpointBookmark bookmark) : base(eventKind, sourcePosition, typeEntry, methodEntry) { this.bookmark = bookmark; InvalidateBookmark(); }
public void ReadFromFile(string fileName) { dataFileName = fileName; namespaces = new Hashtable(); classes = new Hashtable(); long begin = DateTime.Now.Ticks / 10000; long msec = DateTime.Now.Ticks / 10000; long msec2; loadedAssemblies = new Hashtable(); symbolFiles = new Hashtable(); XmlDocument dom = new XmlDocument(); Progress("XML reading", 0); Console.Write("Loading " + fileName + "..."); dom.Load(new XmlTextReader(new FileStream(fileName, FileMode.Open))); Console.WriteLine(" Done."); msec2 = DateTime.Now.Ticks / 10000; Console.WriteLine("XML Reading: " + (msec2 - msec) + " msec"); msec = msec2; Progress("Load assemblies", 0.2); LoadAssemblies(dom); LoadFilters(dom); msec2 = DateTime.Now.Ticks / 10000; Console.WriteLine("Load assemblies: " + (msec2 - msec) + " msec"); msec = msec2; Progress("Load methods", 0.4); foreach (XmlNode n in dom.GetElementsByTagName("method")) { string assemblyName = n.Attributes ["assembly"].Value; string className = n.Attributes ["class"].Value; string methodName = n.Attributes ["name"].Value; string token = n.Attributes ["token"].Value; string cov_info = n.FirstChild.Value; int itok = int.Parse(token); #if USE_REFLECTION Assembly assembly = (Assembly)loadedAssemblies [assemblyName]; MonoSymbolFile symbolFile = (MonoSymbolFile)symbolFiles [assembly]; if (symbolFile == null) { continue; } Type t = LoadType(assembly, className); if (t == null) { Console.WriteLine("ERROR: Unable to resolve type " + className + " in " + assembly); continue; } ClassCoverageItem klass = ProcessClass(t); MethodEntry entry = symbolFile.GetMethodByToken(Int32.Parse(token)); Module[] modules = assembly.GetModules(); if (modules.Length > 1) { Console.WriteLine("WARNING: Assembly had more than one module. Using the first."); } Module module = modules[0]; MethodBase monoMethod = module.ResolveMethod(Int32.Parse(token)); ProcessMethod(monoMethod, entry, klass, methodName, cov_info); #else if ((TokenType)(itok & 0xff000000) != TokenType.Method) { continue; } AssemblyDefinition assembly = (AssemblyDefinition)loadedAssemblies [assemblyName]; MonoSymbolFile symbolFile = (MonoSymbolFile)symbolFiles [assembly]; if (symbolFile == null) { continue; } TypeDefinition t = LoadType(assembly, className); if (t == null) { Console.WriteLine("ERROR: Unable to resolve type " + className + " in " + assembly); continue; } ClassCoverageItem klass = ProcessClass(t); MethodEntry entry = symbolFile.GetMethodByToken(itok); MethodDefinition monoMethod = assembly.MainModule.LookupByToken( new MetadataToken((TokenType)(itok & 0xff000000), (uint)(itok & 0xffffff))) as MethodDefinition; //Console.WriteLine (monoMethod); ProcessMethod(monoMethod, entry, klass, methodName, cov_info); #endif } msec2 = DateTime.Now.Ticks / 10000; Console.WriteLine("Process methods: " + (msec2 - msec) + " msec"); msec = msec2; // Add info for klasses for which we have no coverage #if USE_REFLECTION foreach (Assembly assembly in loadedAssemblies.Values) { foreach (Type t in assembly.GetTypes()) { ProcessClass(t); } } // Add info for methods for which we have no coverage foreach (ClassCoverageItem klass in classes.Values) { foreach (MethodInfo mb in klass.type.GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly)) { MonoSymbolFile symbolFile = (MonoSymbolFile)symbolFiles [klass.type.Assembly]; if (symbolFile == null) { continue; } if (!klass.methodsByMethod.ContainsKey(mb)) { MethodEntry entry = symbolFile.GetMethod(mb); ProcessMethod(mb, entry, klass, mb.Name, null); } } } #else Progress("Not covered classes", 0.6); foreach (AssemblyDefinition assembly in loadedAssemblies.Values) { foreach (TypeDefinition t in assembly.MainModule.Types) { ProcessClass(t); } } Progress("Not covered methods", 0.7); // Add info for methods for which we have no coverage foreach (ClassCoverageItem klass in classes.Values) { foreach (MethodDefinition mb in klass.type.Methods) { MonoSymbolFile symbolFile = (MonoSymbolFile)symbolFiles [klass.type.Module.Assembly]; if (symbolFile == null) { continue; } if (!klass.methodsByMethod.ContainsKey(mb)) { MethodEntry entry = symbolFile.GetMethodByToken((int)mb.MetadataToken.ToUInt()); ProcessMethod(mb, entry, klass, mb.Name, null); } } } #endif msec2 = DateTime.Now.Ticks / 10000; Console.WriteLine("Additional classes: " + (msec2 - msec) + " msec"); msec = msec2; Progress("Compute coverage", 0.9); // Compute coverage for all items computeCoverage(true); msec2 = DateTime.Now.Ticks / 10000; Console.WriteLine("Compute coverage: " + (msec2 - msec) + " msec"); msec = msec2; Console.WriteLine("All: " + (msec2 - begin) + " msec"); Progress("Done loading", 0.9); // Free memory symbolFiles = null; }
private void HandleCompositeCommand(JdwpPacket packet) { var data = packet.Data; var suspendPolicy = (Jdwp.SuspendPolicy) data.GetByte(); var count = data.GetInt(); for (var i = 0; i < count; i++) { var eventKind = (Jdwp.EventKind) data.GetByte(); JdwpEvent evt; switch (eventKind) { case Jdwp.EventKind.VmInit: evt = new VmStart(data); break; case Jdwp.EventKind.SingleStep: evt = new SingleStep(data); break; case Jdwp.EventKind.BreakPoint: evt = new Breakpoint(data); break; case Jdwp.EventKind.MethodEntry: evt = new MethodEntry(data); break; case Jdwp.EventKind.MethodExit: evt = new MethodExit(data); break; case Jdwp.EventKind.Exception: evt = new Exception(data); break; case Jdwp.EventKind.ThreadStart: evt = new ThreadStart(data); break; case Jdwp.EventKind.ThreadEnd: evt = new ThreadDeath(data); break; case Jdwp.EventKind.ClassPrepare: evt = new ClassPrepare(data); break; case Jdwp.EventKind.ClassUnload: evt = new ClassUnload(data); break; case Jdwp.EventKind.FieldAccess: evt = new FieldAccess(data); break; case Jdwp.EventKind.FieldModification: evt = new FieldModification(data); break; case Jdwp.EventKind.VmDeath: evt = new VmDeath(data); break; default: throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind); } DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt); Task.Factory.StartNew(() => { evt.Accept(compositeCommandProcessor, suspendPolicy); }).ContinueWith(task => { DLog.Error(DContext.DebuggerLibJdwpConnection, "HandleCompositeCommand: Internal failure on event processing. SuspendPolicy was {1}; IsCancelled={0}. Exception={1}", suspendPolicy, task.IsCanceled, task.Exception); if (suspendPolicy != Jdwp.SuspendPolicy.None) { // we should better resume the VM, as the command handler may have failed to do so. if(Connected) VirtualMachine.ResumeAsync(); } }, TaskContinuationOptions.NotOnRanToCompletion); } }
public static bool HasColumnInfo(this MethodEntry entry) { return((entry.MethodFlags & MethodEntry.Flags.ColumnsInfoIncluded) != 0); }
/// <summary> /// Create new constructor view model from constructor method view model /// </summary> public ConstructorViewModel(MethodEntry model) { UpdateModel(model); }
public void AddMethod(MethodEntry entry) { methods.Add (entry); }
/// <summary> /// Default ctor /// </summary> public DalvikLocationBreakpoint(Jdwp.EventKind eventKind, SourceCodePosition sourcePosition, TypeEntry typeEntry, MethodEntry methodEntry) : base(eventKind) { this.typeEntry = typeEntry; this.methodEntry = methodEntry; SourceCodePosition = sourcePosition; }
public Task <ResourceModel> CreateResource(string typeName, MethodEntry constructor) { return(WcfClient.CreateAsync(typeName, constructor)); }
private void HandleCompositeCommand(JdwpPacket packet) { var data = packet.Data; var suspendPolicy = (Jdwp.SuspendPolicy)data.GetByte(); var count = data.GetInt(); for (var i = 0; i < count; i++) { var eventKind = (Jdwp.EventKind)data.GetByte(); JdwpEvent evt; switch (eventKind) { case Jdwp.EventKind.VmInit: evt = new VmStart(data); break; case Jdwp.EventKind.SingleStep: evt = new SingleStep(data); break; case Jdwp.EventKind.BreakPoint: evt = new Breakpoint(data); break; case Jdwp.EventKind.MethodEntry: evt = new MethodEntry(data); break; case Jdwp.EventKind.MethodExit: evt = new MethodExit(data); break; case Jdwp.EventKind.Exception: evt = new Exception(data); break; case Jdwp.EventKind.ThreadStart: evt = new ThreadStart(data); break; case Jdwp.EventKind.ThreadEnd: evt = new ThreadDeath(data); break; case Jdwp.EventKind.ClassPrepare: evt = new ClassPrepare(data); break; case Jdwp.EventKind.ClassUnload: evt = new ClassUnload(data); break; case Jdwp.EventKind.FieldAccess: evt = new FieldAccess(data); break; case Jdwp.EventKind.FieldModification: evt = new FieldModification(data); break; case Jdwp.EventKind.VmDeath: evt = new VmDeath(data); break; default: throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind); } DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt); Task.Factory.StartNew(() => { evt.Accept(compositeCommandProcessor, suspendPolicy); }).ContinueWith(task => { DLog.Error(DContext.DebuggerLibJdwpConnection, "HandleCompositeCommand: Internal failure on event processing. SuspendPolicy was {1}; IsCancelled={0}. Exception={1}", suspendPolicy, task.IsCanceled, task.Exception); if (suspendPolicy != Jdwp.SuspendPolicy.None) { // we should better resume the VM, as the command handler may have failed to do so. if (Connected) { VirtualMachine.ResumeAsync(); } } }, TaskContinuationOptions.NotOnRanToCompletion); } }
/// <summary> /// Does this method method the name and signature in the given method entry? /// </summary> public bool IsMatch(MethodEntry entry) { return((Name == entry.DexName) && (Signature == entry.DexSignature)); }
private void HandleCompositeCommand(JdwpPacket packet) { var data = packet.Data; var suspendPolicy = (Jdwp.SuspendPolicy)data.GetByte(); var count = data.GetInt(); for (var i = 0; i < count; i++) { var eventKind = (Jdwp.EventKind)data.GetByte(); JdwpEvent evt; switch (eventKind) { case Jdwp.EventKind.VmInit: evt = new VmStart(data); break; case Jdwp.EventKind.SingleStep: evt = new SingleStep(data); break; case Jdwp.EventKind.BreakPoint: evt = new Breakpoint(data); break; case Jdwp.EventKind.MethodEntry: evt = new MethodEntry(data); break; case Jdwp.EventKind.MethodExit: evt = new MethodExit(data); break; case Jdwp.EventKind.Exception: evt = new Exception(data); break; case Jdwp.EventKind.ThreadStart: evt = new ThreadStart(data); break; case Jdwp.EventKind.ThreadEnd: evt = new ThreadDeath(data); break; case Jdwp.EventKind.ClassPrepare: evt = new ClassPrepare(data); break; case Jdwp.EventKind.ClassUnload: evt = new ClassUnload(data); break; case Jdwp.EventKind.FieldAccess: evt = new FieldAccess(data); break; case Jdwp.EventKind.FieldModification: evt = new FieldModification(data); break; case Jdwp.EventKind.VmDeath: evt = new VmDeath(data); break; default: throw new ArgumentException("Unknown event kind in compositive command " + (int)eventKind); } DLog.Debug(DContext.DebuggerLibDebugger, "JDWP event {0} {1}", eventKind, evt); Task.Factory.StartNew(() => { evt.Accept(compositeCommandProcessor, suspendPolicy); }); } }
public override void InvokeMethod(object fixture, MethodEntry testMethod) { if (testMethod.MethodType == MethodType.FixtureSetUpMethod) { // TODO: Need to get test context here from instance then pass it to setup method. [18mar09, ml] // "Using the TestContext class": http://msdn.microsoft.com/en-us/library/ms404699.aspx testMethod.Invoke(fixture, new object[]{null}); } else { testMethod.Invoke(fixture); } }
public abstract void InvokeMethod(object fixture, MethodEntry testMethod);
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, Document document, DocumentPosition position, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) { throw new ArgumentNullException("location"); } Location = location; Document = document; Position = position; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
public virtual TResult Visit(MethodEntry e, TData data) { return(Visit((JdwpEvent)e, data)); }
protected void CheckMethod(MethodEntry method) { Cecil.MethodDefinition mdef = (Cecil.MethodDefinition)Assembly.MainModule.LookupToken( new Cecil.MetadataToken(Cecil.TokenType.Method, method.Token & 0xffffff)); if ((mdef == null) || (mdef.Body == null)) { throw new MonoSymbolFileException("Method {0} (token {1:x}) not found in assembly.", method.Index, method.Token); } string name = String.Format("{0} ({1})", method.Index, GetMethodName(mdef)); Debug("[Method {0} - {1} - {2}]", method.Index, method.CompileUnit.SourceFile.FileName, GetMethodName(mdef)); LineNumberTable lnt = method.GetLineNumberTable(); if (lnt == null) { throw new MonoSymbolFileException("Cannot get LNT from method {0}.", name); } if (lnt.LineNumbers == null) { throw new MonoSymbolFileException("Cannot get LNT from method {0}.", name); } LineNumberEntry start, end; if (lnt.GetMethodBounds(out start, out end)) { Debug(" Bounds: {0} {1}", start, end); } foreach (LineNumberEntry line in lnt.LineNumbers) { Debug(" Line: {0}", line); } CodeBlockEntry[] blocks = method.GetCodeBlocks() ?? new CodeBlockEntry [0]; foreach (CodeBlockEntry block in blocks) { if ((block.Parent >= 0) && (block.Parent >= blocks.Length)) { throw new MonoSymbolFileException( "Code block {0} in method {1} has invalid parent index {2} (valid is 0..{3}).", block, name, block.Parent, blocks.Length); } } LocalVariableEntry[] locals = method.GetLocals() ?? new LocalVariableEntry [0]; foreach (LocalVariableEntry local in locals) { if ((local.BlockIndex < 0) || ((local.BlockIndex > 0) && (local.BlockIndex > blocks.Length))) { throw new MonoSymbolFileException( "Local variable {0} in method {1} has invalid block index {2} (valid is 0..{3}).", local, name, local.BlockIndex, blocks.Length); } Debug(" Local: {0}", local); } int num_locals = mdef.Body.Variables.Count; ScopeVariable[] scope_vars = method.GetScopeVariables() ?? new ScopeVariable [0]; foreach (ScopeVariable var in scope_vars) { Debug(" Scope var: {0}", var); if ((mdef.IsStatic) && (var.Index < 0)) { throw new MonoSymbolFileException( "Method {0} has invalid scope variable {1} (referencing `this' in static method).", name, var); } if ((var.Index >= 0) && (var.Index >= num_locals)) { throw new MonoSymbolFileException( "Method {0} has invalid scope variable {1} (index out of bounds: {2} / {3}).", name, var, var.Index, num_locals); } if ((var.Scope > 0) && (File.GetAnonymousScope(var.Scope) == null)) { throw new MonoSymbolFileException( "Method {0} has invalid scope variable {1} (can't find scope {2}).", name, var, var.Scope); } } }
/// <summary> /// Create a new location breakpoint. /// </summary> protected override DalvikLocationBreakpoint CreateLocationBreakpoint(DocumentPosition documentPosition, TypeEntry typeEntry, MethodEntry methodEntry, object data) { // Create breakpoint objects var pendingBreakpoint = (DebugPendingBreakpoint)data; var boundBreakpoint = new DebugBoundBreakpoint <DebugLocationBreakpoint>(pendingBreakpoint, this, enum_BP_TYPE.BPT_CODE, x => new DebugLocationBreakpoint(Jdwp.EventKind.BreakPoint, documentPosition, typeEntry, methodEntry, x)); // Return breakpoint return(boundBreakpoint.Breakpoint); }
public void HandleMethodEntry(MethodEntry entry, int indentLevel, bool displayEnabled) { this.AddLine(this.Formatter.FormatMethodEntry(this.CurrentThreadId, indentLevel, ++_lineNumber, entry, this.Filters, displayEnabled), indentLevel); }
/// <summary> /// Default ctor /// </summary> public DocumentLocation(Location location, SourceCodePosition sourceCode, DalvikReferenceType referenceType, DalvikMethod method, TypeEntry typeEntry, MethodEntry methodEntry) { if (location == null) { throw new ArgumentNullException("location"); } Location = location; SourceCode = sourceCode; ReferenceType = referenceType; Method = method; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
/// <summary> /// Default ctor /// </summary> public DalvikLocationBreakpoint(Jdwp.EventKind eventKind, DocumentPosition documentPosition, TypeEntry typeEntry, MethodEntry methodEntry) : base(eventKind) { this.documentPosition = documentPosition; this.typeEntry = typeEntry; this.methodEntry = methodEntry; }
public Entry InvokeMethod(string moduleName, MethodEntry method) { throw new NotImplementedException(); }
private void ProcessMethod(MethodBase monoMethod, MethodEntry entry, ClassCoverageItem klass, string methodName, string cov_info)
public Task <Entry> InvokeMethodAsync(string moduleName, MethodEntry method) { throw new NotImplementedException(); }
public void DefineMethod(MonoSymbolFile file, int token) { MethodEntry entry = new MethodEntry ( file, _comp_unit.Entry, token, ScopeVariables, Locals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id); file.AddMethod (entry); }
private static void AddMethodTreeNode(TreeNode classNode, MethodEntry md) { classNode.Nodes.Add(new MethodTreeNode(md)); }
public static bool HasEndInfo(this MethodEntry entry) { return((entry.MethodFlags & MethodEntry.Flags.EndInfoIncluded) != 0); }
/// <summary> /// Creates a ViewModel from the given Model /// </summary> public ResourceMethodViewModel(MethodEntry model) { UpdateModel(model); }
public override void InvokeMethod(object fixture, MethodEntry testMethod) { testMethod.Invoke(fixture); }
public abstract void InvokeMethod(object fixture, MethodEntry testMethod);