Ejemplo n.º 1
0
        public DebuggerRuntimeImpl(DbgObjectIdService dbgObjectIdService, IDbgDotNetRuntime runtime, int pointerSize, DotNetClassHookFactory[] dotNetClassHookFactories)
        {
            if (dotNetClassHookFactories is null)
            {
                throw new ArgumentNullException(nameof(dotNetClassHookFactories));
            }
            argumentsProvider         = null !;
            evalInfo                  = null !;
            this.dbgObjectIdService   = dbgObjectIdService ?? throw new ArgumentNullException(nameof(dbgObjectIdService));
            this.runtime              = runtime ?? throw new ArgumentNullException(nameof(runtime));
            valuesToDispose           = new List <DbgDotNetValue>();
            interpreterLocalsProvider = new InterpreterLocalsProvider(this);
            PointerSize               = pointerSize;

            var anyClassHooksList = new List <DotNetClassHook>();

            classHooks = new Dictionary <DmdTypeName, DotNetClassHook>(DmdTypeNameEqualityComparer.Instance);
            foreach (var factory in dotNetClassHookFactories)
            {
                foreach (var info in factory.Create(this))
                {
                    Debug.Assert(!(info.Hook is null));
                    if (info.WellKnownType is null && info.TypeName is null)
                    {
                        anyClassHooksList.Add(info.Hook);
                    }
Ejemplo n.º 2
0
		public DebuggerRuntimeImpl(DbgObjectIdService dbgObjectIdService, IDbgDotNetRuntime runtime, int pointerSize, DotNetClassHookFactory[] dotNetClassHookFactories) {
			if (dotNetClassHookFactories == null)
				throw new ArgumentNullException(nameof(dotNetClassHookFactories));
			this.dbgObjectIdService = dbgObjectIdService ?? throw new ArgumentNullException(nameof(dbgObjectIdService));
			this.runtime = runtime ?? throw new ArgumentNullException(nameof(runtime));
			valuesToDispose = new List<DbgDotNetValue>();
			PointerSize = pointerSize;

			var anyClassHooksList = new List<DotNetClassHook>();
			classHooks = new Dictionary<DmdTypeName, DotNetClassHook>(DmdTypeNameEqualityComparer.Instance);
			foreach (var factory in dotNetClassHookFactories) {
				foreach (var info in factory.Create(this)) {
					Debug.Assert(info.Hook != null);
					if (info.WellKnownType == null && info.TypeName == null)
						anyClassHooksList.Add(info.Hook);
					else {
						DmdTypeName typeName;
						if (info.WellKnownType != null)
							typeName = DmdWellKnownTypeUtils.GetTypeName(info.WellKnownType.Value);
						else {
							Debug.Assert(info.TypeName != null);
							typeName = info.TypeName.Value;
						}
						Debug.Assert(!classHooks.ContainsKey(typeName));
						classHooks[typeName] = info.Hook;
					}
				}
			}
			anyClassHooks = anyClassHooksList.ToArray();
		}
 public DbgEngineExpressionEvaluatorImpl(DbgModuleReferenceProvider dbgModuleReferenceProvider, DbgDotNetExpressionCompiler expressionCompiler, DbgDotNetILInterpreter dnILInterpreter, DbgObjectIdService objectIdService, IPredefinedEvaluationErrorMessagesHelper predefinedEvaluationErrorMessagesHelper)
 {
     this.dbgModuleReferenceProvider = dbgModuleReferenceProvider ?? throw new ArgumentNullException(nameof(dbgModuleReferenceProvider));
     this.expressionCompiler         = expressionCompiler ?? throw new ArgumentNullException(nameof(expressionCompiler));
     this.dnILInterpreter            = dnILInterpreter ?? throw new ArgumentNullException(nameof(dnILInterpreter));
     this.objectIdService            = objectIdService ?? throw new ArgumentNullException(nameof(objectIdService));
     this.predefinedEvaluationErrorMessagesHelper = predefinedEvaluationErrorMessagesHelper ?? throw new ArgumentNullException(nameof(predefinedEvaluationErrorMessagesHelper));
 }
Ejemplo n.º 4
0
 ValueNodesVMFactoryImpl(UIDispatcher uiDispatcher, ITreeViewService treeViewService, LanguageEditValueProviderFactory languageEditValueProviderFactory, DbgValueNodeImageReferenceService dbgValueNodeImageReferenceService, DebuggerSettings debuggerSettings, DbgEvalFormatterSettings dbgEvalFormatterSettings, DbgObjectIdService dbgObjectIdService, IClassificationFormatMapService classificationFormatMapService, ITextBlockContentInfoFactory textBlockContentInfoFactory, IMenuService menuService, IWpfCommandService wpfCommandService)
 {
     uiDispatcher.VerifyAccess();
     this.uiDispatcher    = uiDispatcher;
     this.treeViewService = treeViewService;
     this.languageEditValueProviderFactory  = languageEditValueProviderFactory;
     this.dbgValueNodeImageReferenceService = dbgValueNodeImageReferenceService;
     this.debuggerSettings               = debuggerSettings;
     this.dbgEvalFormatterSettings       = dbgEvalFormatterSettings;
     this.dbgObjectIdService             = dbgObjectIdService;
     this.classificationFormatMapService = classificationFormatMapService;
     this.textBlockContentInfoFactory    = textBlockContentInfoFactory;
     this.menuService       = menuService;
     this.wpfCommandService = wpfCommandService;
 }
Ejemplo n.º 5
0
        public DbgEngineLanguageImpl(DbgModuleReferenceProvider dbgModuleReferenceProvider, string name, string displayName, DbgDotNetExpressionCompiler expressionCompiler, DbgMetadataService dbgMetadataService, IDecompiler decompiler, DbgDotNetFormatter formatter, DbgDotNetEngineValueNodeFactory valueNodeFactory, DbgDotNetILInterpreter dnILInterpreter, DbgObjectIdService objectIdService, 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 (objectIdService == null)
            {
                throw new ArgumentNullException(nameof(objectIdService));
            }
            if (predefinedEvaluationErrorMessagesHelper == null)
            {
                throw new ArgumentNullException(nameof(predefinedEvaluationErrorMessagesHelper));
            }
            Name                    = name ?? throw new ArgumentNullException(nameof(name));
            DisplayName             = displayName ?? throw new ArgumentNullException(nameof(displayName));
            this.dbgMetadataService = dbgMetadataService ?? throw new ArgumentNullException(nameof(dbgMetadataService));
            this.expressionCompiler = expressionCompiler ?? throw new ArgumentNullException(nameof(expressionCompiler));
            this.decompiler         = decompiler ?? throw new ArgumentNullException(nameof(decompiler));
            var expressionEvaluator = new DbgEngineExpressionEvaluatorImpl(dbgModuleReferenceProvider, expressionCompiler, dnILInterpreter, objectIdService, predefinedEvaluationErrorMessagesHelper);

            ExpressionEvaluator               = expressionEvaluator;
            ValueFormatter                    = new DbgEngineValueFormatterImpl(formatter);
            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);
            debuggerDisplayAttributeEvaluator = expressionEvaluator;
        }
Ejemplo n.º 6
0
 DbgCodeBreakpointConditionCheckerImpl(DbgLanguageService dbgLanguageService, DbgObjectIdService dbgObjectIdService)
 {
     this.dbgLanguageService = dbgLanguageService;
     this.dbgObjectIdService = dbgObjectIdService;
 }
Ejemplo n.º 7
0
 DbgAliasProviderImpl(DbgObjectIdService objectIdService) => this.objectIdService = objectIdService;
 public LocalsVariablesWindowValueNodesProvider(DbgObjectIdService dbgObjectIdService, DebuggerSettings debuggerSettings)
 {
     this.dbgObjectIdService = dbgObjectIdService ?? throw new ArgumentNullException(nameof(dbgObjectIdService));
     this.debuggerSettings   = debuggerSettings ?? throw new ArgumentNullException(nameof(debuggerSettings));
 }
Ejemplo n.º 9
0
 public WatchVariablesWindowValueNodesProviderImpl(DbgObjectIdService dbgObjectIdService, string[] savedExpressions, Action <string[]> saveExpressions)
 {
     this.dbgObjectIdService = dbgObjectIdService ?? throw new ArgumentNullException(nameof(dbgObjectIdService));
     expressions             = new List <ExpressionInfo>(savedExpressions.Select(a => new ExpressionInfo(GetNextId(), a, forceEval: false)));
     this.saveExpressions    = saveExpressions ?? throw new ArgumentNullException(nameof(saveExpressions));
 }
Ejemplo n.º 10
0
 DebuggerRuntimeFactoryImpl(DbgObjectIdService dbgObjectIdService, [ImportMany] IEnumerable <DotNetClassHookFactory> dotNetClassHookFactories)
 {
     this.dbgObjectIdService       = dbgObjectIdService;
     this.dotNetClassHookFactories = dotNetClassHookFactories.ToArray();
 }
Ejemplo n.º 11
0
 LocalsContent(IWpfCommandService wpfCommandService, VariablesWindowVMFactory variablesWindowVMFactory, DbgObjectIdService dbgObjectIdService, DebuggerSettings debuggerSettings)
 {
     this.dbgObjectIdService = dbgObjectIdService;
     this.debuggerSettings   = debuggerSettings;
     Initialize(wpfCommandService, variablesWindowVMFactory, CreateVariablesWindowVMOptions());
 }