Example #1
0
        public DbgEngineLanguageImpl(DbgModuleReferenceProvider dbgModuleReferenceProvider, string name, string displayName, DbgDotNetExpressionCompiler expressionCompiler, DbgMetadataService dbgMetadataService, IDecompiler decompiler, DbgDotNetFormatter formatter, DbgDotNetEngineValueNodeFactory valueNodeFactory)
        {
            if (dbgModuleReferenceProvider == null)
            {
                throw new ArgumentNullException(nameof(dbgModuleReferenceProvider));
            }
            if (expressionCompiler == null)
            {
                throw new ArgumentNullException(nameof(expressionCompiler));
            }
            if (formatter == null)
            {
                throw new ArgumentNullException(nameof(formatter));
            }
            Name                    = name ?? throw new ArgumentNullException(nameof(name));
            DisplayName             = displayName ?? throw new ArgumentNullException(nameof(displayName));
            this.dbgMetadataService = dbgMetadataService ?? throw new ArgumentNullException(nameof(dbgMetadataService));
            this.decompiler         = decompiler ?? throw new ArgumentNullException(nameof(decompiler));
            var dnILInterpreter     = new DbgDotNetILInterpreterImpl();
            var expressionEvaluator = new DbgEngineExpressionEvaluatorImpl(dbgModuleReferenceProvider, expressionCompiler, dnILInterpreter);

            ExpressionEvaluator   = expressionEvaluator;
            ValueFormatter        = new DbgEngineValueFormatterImpl();
            Formatter             = new DbgEngineFormatterImpl(formatter);
            LocalsProvider        = new DbgEngineLocalsProviderImpl(dbgModuleReferenceProvider, expressionCompiler, valueNodeFactory, dnILInterpreter);
            AutosProvider         = new DbgEngineAutosProviderImpl(valueNodeFactory);
            ExceptionsProvider    = new DbgEngineExceptionsProviderImpl(valueNodeFactory);
            ReturnValuesProvider  = new DbgEngineReturnValuesProviderImpl(valueNodeFactory);
            TypeVariablesProvider = new DbgEngineTypeVariablesProviderImpl(valueNodeFactory);
            ValueNodeFactory      = new DbgEngineValueNodeFactoryImpl(expressionEvaluator, valueNodeFactory, formatter);
        }
        public DbgEngineLanguageImpl(DbgModuleReferenceProvider dbgModuleReferenceProvider, string name, string displayName, DbgDotNetExpressionCompiler expressionCompiler, DbgMethodDebugInfoProvider dbgMethodDebugInfoProvider, IDecompiler decompiler, DbgDotNetFormatter formatter, DbgDotNetEngineValueNodeFactory valueNodeFactory, DbgDotNetILInterpreter dnILInterpreter, DbgAliasProvider dbgAliasProvider, IPredefinedEvaluationErrorMessagesHelper predefinedEvaluationErrorMessagesHelper)
        {
            if (dbgModuleReferenceProvider == null)
            {
                throw new ArgumentNullException(nameof(dbgModuleReferenceProvider));
            }
            if (formatter == null)
            {
                throw new ArgumentNullException(nameof(formatter));
            }
            if (valueNodeFactory == null)
            {
                throw new ArgumentNullException(nameof(valueNodeFactory));
            }
            if (dnILInterpreter == null)
            {
                throw new ArgumentNullException(nameof(dnILInterpreter));
            }
            if (dbgAliasProvider == null)
            {
                throw new ArgumentNullException(nameof(dbgAliasProvider));
            }
            if (predefinedEvaluationErrorMessagesHelper == null)
            {
                throw new ArgumentNullException(nameof(predefinedEvaluationErrorMessagesHelper));
            }
            Name        = name ?? throw new ArgumentNullException(nameof(name));
            DisplayName = displayName ?? throw new ArgumentNullException(nameof(displayName));
            this.dbgMethodDebugInfoProvider = dbgMethodDebugInfoProvider ?? throw new ArgumentNullException(nameof(dbgMethodDebugInfoProvider));
            this.expressionCompiler         = expressionCompiler ?? throw new ArgumentNullException(nameof(expressionCompiler));
            this.decompiler = decompiler ?? throw new ArgumentNullException(nameof(decompiler));
            var expressionEvaluator = new DbgEngineExpressionEvaluatorImpl(dbgModuleReferenceProvider, expressionCompiler, dnILInterpreter, dbgAliasProvider, predefinedEvaluationErrorMessagesHelper);

            ExpressionEvaluator               = expressionEvaluator;
            Formatter                         = new DbgEngineFormatterImpl(formatter);
            LocalsProvider                    = new DbgEngineLocalsProviderImpl(dbgModuleReferenceProvider, expressionCompiler, valueNodeFactory, dnILInterpreter, dbgAliasProvider);
            AutosProvider                     = new DbgEngineAutosProviderImpl(valueNodeFactory);
            ExceptionsProvider                = new DbgEngineExceptionsProviderImpl(valueNodeFactory);
            ReturnValuesProvider              = new DbgEngineReturnValuesProviderImpl(valueNodeFactory);
            TypeVariablesProvider             = new DbgEngineTypeVariablesProviderImpl(valueNodeFactory);
            ValueNodeFactory                  = new DbgEngineValueNodeFactoryImpl(expressionEvaluator, valueNodeFactory, formatter);
            debuggerDisplayAttributeEvaluator = expressionEvaluator;
        }