Example #1
0
        public SourceAddress(SourceFile file, SourceBuffer buffer, int row,
				      int line_offset, int line_range)
        {
            this.file = file;
            this.buffer = buffer;
            this.row = row;
            this.line_offset = line_offset;
            this.line_range = line_range;
        }
Example #2
0
 public SourceLocation(SourceFile file, int line, int column)
     : this(new DynamicSourceLocation (file, line, column))
 {
     Module = file.Module.Name;
     FileName = file.FileName;
     Name = file.FileName + ":" + line;
     Line = line;
     Column = column;
 }
Example #3
0
        public SourceLocation(MethodSource source, SourceFile file, int line, int column)
            : this(new DynamicSourceLocation (source, file, line, column))
        {
            Module = file.Module.Name;
            FileName = file.FileName;
            Method = source.Name;

            if (line != -1)
                Name = source.Name + ':' + line;
            else
                Name = source.Name;

            Line = line;
            Column = column;
        }
Example #4
0
 public SourceLocation(MethodSource source, SourceFile file, int line)
     : this(source, file, line, -1)
 {
 }
Example #5
0
        public DynamicSourceLocation(TargetFunctionType function, int line, int column)
        {
            this.function = function;
            this.file = null;
            this.module = function.Module;

            this.line = line;
            this.column = column;
        }
Example #6
0
 public DynamicSourceLocation(SourceFile file, int line, int column)
 {
     this.module = file.Module;
     this.file = file;
     this.line = line;
     this.column = column;
 }
Example #7
0
 public SourceLocation(SourceFile file, int line)
     : this(file, line, -1)
 {
 }
Example #8
0
 public abstract MethodSource[] GetMethods(SourceFile file);
Example #9
0
 public void PrintMethods(SourceFile source)
 {
     Print ("Methods from source file {0}: {1}", source.ID, source.FileName);
     PrintMethods (source.Methods);
 }
Example #10
0
 public SourceFile[] GetSources()
 {
     ensure_sources ();
     SourceFile[] retval = new SourceFile [sources.Count];
     sources.CopyTo (retval, 0);
     return retval;
 }
Example #11
0
        public override MethodSource[] GetMethods(SourceFile file)
        {
            ensure_sources ();
            C.SourceFileEntry source = source_hash [file];

            List<MethodSource> methods = new List<MethodSource> ();

            foreach (C.MethodEntry method in File.Methods) {
                var cfile = source_file_hash [method.CompileUnit.SourceFile];
                Cecil.MethodDefinition mdef = MonoDebuggerSupport.GetMethod (
                    ModuleDefinition, method.Token);

                if (method.CompileUnit.SourceFile.Index == source.Index) {
                    methods.Add (GetMethodSource (cfile, method.Index));
                    continue;
                }

                foreach (C.SourceFileEntry include in method.CompileUnit.IncludeFiles) {
                    if (include.Index == source.Index) {
                        methods.Add (GetMethodSource (cfile, method.Index));
                        break;
                    }
                }
            }

            return methods.ToArray ();
        }
Example #12
0
            public MonoMethodSource(MonoSymbolFile file, SourceFile source_file,
						 C.MethodEntry method, Cecil.MethodDefinition mdef,
						 MonoClassType klass, MonoFunctionType function)
            {
                this.file = file;
                this.source_file = source_file;
                this.method = method;
                this.mdef = mdef;
                this.function = function;
                this.klass = klass;

                full_name = method.GetRealName ();
                if (full_name == null)
                    full_name = MonoSymbolFile.GetMethodName (mdef);

                C.LineNumberEntry start, end;
                C.LineNumberTable lnt = method.GetLineNumberTable ();
                if (lnt.GetMethodBounds (out start, out end))
                    start_row = start.Row; end_row = end.Row;
            }
Example #13
0
        public SourceAddress(SourceFile file, SourceBuffer buffer, int row,
				      int line_offset, int line_range, SourceRange? source_range)
            : this(file, buffer, row, line_offset, line_range)
        {
            this.source_range = source_range;
        }
Example #14
0
        protected MethodSource[] GetMethods(SourceFile file)
        {
            if (dwarf != null)
                return dwarf.GetMethods (file);

            throw new InvalidOperationException ();
        }
Example #15
0
 public override MethodSource[] GetMethods(SourceFile file)
 {
     return Bfd.GetMethods (file);
 }
Example #16
0
 public SourceLocation(SourceFile file, int line)
     : this(file, line, -1)
 {
 }
Example #17
0
        MonoMethodSource CreateMethodSource(SourceFile file, int index)
        {
            C.MethodEntry entry = File.GetMethod (index);

            Cecil.MethodDefinition mdef = MonoDebuggerSupport.GetMethod (
                ModuleDefinition, entry.Token);

            MonoClassType klass = LookupMonoClass (mdef.DeclaringType);
            if (klass == null)
                throw new InternalError ();

            MonoFunctionType function = klass.LookupFunction (mdef);

            MonoMethodSource method = new MonoMethodSource (
                this, file, entry, mdef, klass, function);
            method_index_hash.Add (index, method);

            return method;
        }
Example #18
0
        MonoMethodSource GetMethodSource(SourceFile file, int index)
        {
            ensure_sources ();
            MonoMethodSource method = (MonoMethodSource) method_index_hash [index];
            if (method != null)
                return method;

            return CreateMethodSource (file, index);
        }
Example #19
0
 public MethodSource[] GetMethods(SourceFile file)
 {
     return SymbolFile.GetMethods (file);
 }
Example #20
0
        public DynamicSourceLocation(MethodSource source, SourceFile file, int line, int column)
        {
            if (source.IsManaged) {
                this.function = source.Function;
                this.module = function.Module;
            } else {
                this.module = source.Module;
                this.source = source;
            }

            this.file = file;
            this.line = line;
            this.column = column;
        }
Example #21
0
        public SourceFile[] GetSources(int[] indices)
        {
            Hashtable source_hash = new Hashtable ();
            Module[] modules = CurrentProcess.Modules;

            foreach (Module module in modules) {
                if (!module.SymbolsLoaded)
                    continue;

                foreach (SourceFile source in module.Sources)
                    source_hash.Add (source.ID, source);
            }

            int pos = 0;
            SourceFile[] retval = new SourceFile [indices.Length];

            foreach (int index in indices) {
                SourceFile source = (SourceFile) source_hash [index];
                if (source == null)
                    throw new ScriptingException (
                        "No such source file: {0}", index);

                retval [pos++] = source;
            }

            return retval;
        }
Example #22
0
 public SourceLocation(MethodSource source, SourceFile file, int line)
     : this(source, file, line, -1)
 {
 }