Esempio n. 1
0
        private HandlerAction DoTypeLoadEvent(TypeLoadEvent e)
        {
            m_staticFields.AddRange(from f in e.Type.GetFields() where f.IsStatic select f);

            foreach (MethodMirror method in e.Type.GetMethods())
            {
                string path = method.SourceFile;
                if (!string.IsNullOrEmpty(path))
                {
                    List<TypeMirror> types;
                    if (!m_types.TryGetValue(path, out types))
                    {
                        types = new List<TypeMirror>();
                        m_types.Add(path, types);
                    }
                    types.Add(e.Type);

                    Breakpoint[] bps = Breakpoints.GetBreakpoints(path);		// TODO: could probably make this a bit more efficient by using TypeMirror.GetSourceFiles
                    if (bps.Length > 0)
                    {
                        foreach (Breakpoint bp in bps)
                        {
                            Location loc = method.Locations.FirstOrDefault(l => l.LineNumber == bp.Line);
                            if (loc != null)
                            {
                                Contract.Assert(loc.Method == method, "methods don't match");
                                Contract.Assert(loc.SourceFile == path, "paths don't match");

                                AddBreakpoint(bp, method, loc.ILOffset);
                            }
                        }
                    }
                }
            }
            NSApplication.sharedApplication().BeginInvoke(() => m_debugger.OnTypeLoad(e));

            return HandlerAction.Resume;
        }
Esempio n. 2
0
        private void OnTypeLoad(TypeLoadEvent e)
        {
            var debugAssembly = DebugAssemblyFor(e.Type.Assembly);
            var debugType = new SdbTypeMirror(e.Type,debugAssembly);

            TypeLoaded(debugType);
        }
Esempio n. 3
0
 internal void OnTypeLoad(TypeLoadEvent e)
 {
     ms_loadedTypes.Add(e.Type.FullName);
 }