public RuntimeBase(ClrInfo info, DataTargetImpl dataTarget, DacLibrary lib)
        {
            Debug.Assert(lib != null);
            Debug.Assert(lib.DacInterface != null);

            ClrInfo       = info;
            _dataTarget   = dataTarget;
            _library      = lib;
            _dacInterface = _library.DacInterface;
            InitApi();

            _dacInterface.Flush();

            IGCInfo data = GetGCInfo();

            if (data == null)
            {
                throw new ClrDiagnosticsException("This runtime is not initialized and contains no data.", ClrDiagnosticsException.HR.RuntimeUninitialized);
            }

            ServerGC    = data.ServerMode;
            HeapCount   = data.HeapCount;
            CanWalkHeap = data.GCStructuresValid && !dataTarget.DataReader.IsMinidump;
            _dataReader = dataTarget.DataReader;
        }
Exemple #2
0
        public RuntimeBase(ClrInfo info, DataTargetImpl dataTarget, DacLibrary lib)
        {
            Debug.Assert(lib != null);
            Debug.Assert(lib.DacInterface != null);

            ClrInfo       = info;
            _dataTarget   = dataTarget;
            _library      = lib;
            _dacInterface = _library.DacInterface;
            InitApi();

            _dacInterface.Flush();

            IGCInfo data = GetGCInfo();

            if (data != null)
            {
                ServerGC    = data.ServerMode;
                HeapCount   = data.HeapCount;
                CanWalkHeap = data.GCStructuresValid;
            }
            _dataReader = dataTarget.DataReader;
        }