Exemplo n.º 1
0
        protected override void Initialize()
        {
            base.Initialize();
            IFunctionCollection unitCollection = Session.Daemon.Container.Resolve <IFunctionCollection>();

            Model = new UnitCollectionModel <FunctionInfo>(unitCollection);
        }
Exemplo n.º 2
0
        protected override IUnitsModel GetModel()
        {
            IFunctionCollection collection = ProfilingViewModel.Application.ServiceContainer.Resolve <IFunctionCollection>();
            FunctionsModel      model      = new FunctionsModel(collection);

            return(model);
        }
        public void ImportServices(IServiceContainer container)
        {
            IFunctionCollection  functions      = container.Resolve <IFunctionCollection>();
            IThreadCollection    threads        = container.Resolve <IThreadCollection>();
            IEventMessageBuilder messageBuilder = container.Resolve <IEventMessageBuilder>();

            IManagedFunctionCallEventMessage functionCallEventMessage = new ManagedFunctionCallEventMessage(functions);

            messageBuilder.RegisterMessage(ManagedFunctionCallEventMessage.EventType, functionCallEventMessage);

            IManagedToUnmanagedTransactionEventMessage managedToUnmanagedTransactionEventMessage = new ManagedToUnmanagedTransactionEventMessage();

            messageBuilder.RegisterMessage(ManagedToUnmanagedTransactionEventMessage.EventType, managedToUnmanagedTransactionEventMessage);

            IUnmanagedToManagedTransactionEventMessage unmanagedToManagedTransactionEventMessage = new UnmanagedToManagedTransactionEventMessage();

            messageBuilder.RegisterMessage(UnmanagedToManagedTransactionEventMessage.EventType, unmanagedToManagedTransactionEventMessage);

            IThreadCreateEventMessage threadCreateEventMessage = new ThreadCreateEventMessage(threads);

            messageBuilder.RegisterMessage(ThreadCreateEventMessage.EventType, threadCreateEventMessage);

            IThreadDestroyEventMessage threadDestroyEventMessage = new ThreadDestroyEventMessage(threads);

            messageBuilder.RegisterMessage(ThreadDestroyEventMessage.EventType, threadDestroyEventMessage);
        }
 private void SubstituteFunctionDefinitions(IFunctionCollection classDefinition, List <IFunctionDefinition> fdg, IFunctionDefinition combinedFunction)
 {
     foreach (var fd in fdg)
     {
         classDefinition.RemoveFunction(fd);
     }
     classDefinition.AddFunction(combinedFunction);
 }
        public void ImportServices(IServiceContainer container)
        {
            IEventsFormatter    eventsFormatter = container.Resolve <IEventsFormatter>();
            IFunctionCollection functions       = container.Resolve <IFunctionCollection>();
            IThreadCollection   threads         = container.Resolve <IThreadCollection>();

            eventsFormatter.RegisterFormatter(new FunctionCallEventFormatter(functions));
            eventsFormatter.RegisterFormatter(new RootEventFormatter(threads));
        }
 public void SetDependencies(IClassCollection classes, IFunctionCollection functions)
 {
     _classes   = classes;
     _functions = functions;
     foreach (ManagedExceptionInfo unit in this)
     {
         unit.SetDependencies(_classes, _functions);
     }
 }
Exemplo n.º 7
0
        internal static string BuildMessageInternal(IEvent @event, IFunctionCollection functions)
        {
            FunctionInfo functionInfo = functions[@event.Unit];

            if (functionInfo == null)
            {
                return("<UNKNOWN FUNCTION CALL>");
            }
            return(functionInfo.FullName);
        }
Exemplo n.º 8
0
 public FunctionsModel(IFunctionCollection units)
 {
     Units   = units;
     Columns = new List <GridViewDynamicColumn>
     {
         new GridViewDynamicColumn("Name", "Name", FilterByName),
         new GridViewDynamicColumn("Full Name", "FullName", FilterByFullName),
         new GridViewDynamicColumn("Class", "Class.Name", FilterByClass)
     };
 }
Exemplo n.º 9
0
        public RootScope(Context context)
        {
            _context   = context;
            _functions = new FunctionCollection();
            _variables = new VariableCollection();
            _classes   = new ClassCollection();
            _objects   = new ObjectCollection();
            _arrays    = new ArrayCollection();

            StandardLibrary.Populate(_functions);
            StandardLibrary.Populate(_variables);
        }
Exemplo n.º 10
0
        void Gather(IFunctionCollection ctx)
        {
            var overloads = GatherOverloads(ctx);

            foreach (var fs in overloads)
            {
                if (fs.Value.Count > 1)
                {
                    var overloadedFunction = TransformOverloadGroup(fs.Key, fs.Value);
                    SubstituteFunctionDefinitions(ctx, fs.Value, overloadedFunction);
                }
            }
        }
Exemplo n.º 11
0
        public static void Populate(IFunctionCollection functions)
        {
            // core
            functions.Add(new echo());
            functions.Add(new define());
            functions.Add(new defined());
            functions.Add(new isset());
            functions.Add(new die());
            functions.Add(new ini_get());
            functions.Add(new ini_set());
            functions.Add(new error_reporting());
            functions.Add(new func_get_args());

            // system
            functions.Add(new memory_get_peak_usage());
            functions.Add(new memory_get_usage());
            functions.Add(new microtime());

            // IO
            functions.Add(new realpath());
            functions.Add(new dirname());
            functions.Add(new file_exists());
            functions.Add(new is_file());
            functions.Add(new is_dir());
            functions.Add(new mkdir());

            // functions/classes
            functions.Add(new function_exists());
            functions.Add(new class_exists());
            functions.Add(new interface_exists());
            functions.Add(new get_class());

            // type check
            functions.Add(new is_array());
            functions.Add(new is_object());
            functions.Add(new is_string());
            functions.Add(new is_null());

            // string
            functions.Add(new mb_substr());
            functions.Add(new trim());
            functions.Add(new ltrim());
            functions.Add(new rtrim());
            functions.Add(new strpos());
            functions.Add(new stripos());
            functions.Add(new strrpos());
            functions.Add(new strripos());
            functions.Add(new str_replace());
            functions.Add(new str_ireplace());

            // array
            functions.Add(new count());
            functions.Add(new @sizeof());
            functions.Add(new in_array());
            functions.Add(new array_key_exists());
            functions.Add(new array_merge());
            functions.Add(new array_shift());

            // network
            functions.Add(new gethostbyname());
            functions.Add(new gethostname());
        }
 public void SetDependencies(IFunctionCollection functions)
 {
     _functions = functions;
 }
Exemplo n.º 13
0
 public ManagedFunctionCallEventMessage(IFunctionCollection functions)
 {
     _functions = functions;
 }
Exemplo n.º 14
0
        private IDictionary <IFunctionSignature, List <IFunctionDefinition> > GatherOverloads(IFunctionCollection classDefinition)
        {
            var result = new Dictionary <IFunctionSignature, List <IFunctionDefinition> >();
            var x      = classDefinition.Functions.GroupBy(f => f.GetFunctionSignature(), f => f, new SignaturesAreEqual());

            foreach (var f in classDefinition.Functions)
            {
                var signature = f.GetFunctionSignature();

                if (!result.ContainsKey(signature))
                {
                    result[signature] = new List <IFunctionDefinition>();
                }

                result[signature].Add(f);
            }

            return(result);
        }
Exemplo n.º 15
0
 public FunctionCallEventFormatter(IFunctionCollection functions)
 {
     _functions = functions;
 }
 public ManagedExceptionInfo(ManagedExceptionNativeInfo queryInfo, IClassCollection classes, IFunctionCollection functions)
     : base(queryInfo)
 {
     SetDependencies(classes, functions);
 }
 internal void SetDependencies(IClassCollection classes, IFunctionCollection functions)
 {
     _classes   = classes;
     _functions = functions;
 }
Exemplo n.º 18
0
        protected override IUnitsModel CreateModel(ISession session)
        {
            IFunctionCollection units = session.ServiceContainer.Resolve <IFunctionCollection>();

            return(new FunctionsModel(units));
        }