Esempio n. 1
0
        public V45Runtime(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
            : base(info, dt, lib)
        {
            if (!GetCommonMethodTables(ref _commonMTs))
            {
                throw new ClrDiagnosticsException("Could not request common MethodTable list.", ClrDiagnosticsException.HR.DacError);
            }

            if (!_commonMTs.Validate())
            {
                CanWalkHeap = false;
            }

            // Ensure the version of the dac API matches the one we expect.  (Same for both
            // v2 and v4 rtm.)
            byte[] tmp = new byte[sizeof(int)];

            if (!Request(DacRequests.VERSION, null, tmp))
            {
                throw new ClrDiagnosticsException("Failed to request dac version.", ClrDiagnosticsException.HR.DacError);
            }

            int v = BitConverter.ToInt32(tmp, 0);

            if (v != 9)
            {
                throw new ClrDiagnosticsException("Unsupported dac version.", ClrDiagnosticsException.HR.DacError);
            }
        }
Esempio n. 2
0
        public DacDataTargetWrapper(DataTargetImpl dataTarget)
        {
            _dataTarget = dataTarget;
            _dataReader = _dataTarget.DataReader;
            _modules    = dataTarget.EnumerateModules().ToArray();
            Array.Sort(_modules, delegate(ModuleInfo a, ModuleInfo b) { return(a.ImageBase.CompareTo(b.ImageBase)); });

            VtableBuilder builder = AddInterface(IID_IDacDataTarget);

            builder.AddMethod(new GetMachineTypeDelegate(GetMachineType));
            builder.AddMethod(new GetPointerSizeDelegate(GetPointerSize));
            builder.AddMethod(new GetImageBaseDelegate(GetImageBase));
            builder.AddMethod(new ReadVirtualDelegate(ReadVirtual));
            builder.AddMethod(new WriteVirtualDelegate(WriteVirtual));
            builder.AddMethod(new GetTLSValueDelegate(GetTLSValue));
            builder.AddMethod(new SetTLSValueDelegate(SetTLSValue));
            builder.AddMethod(new GetCurrentThreadIDDelegate(GetCurrentThreadID));
            builder.AddMethod(new GetThreadContextDelegate(GetThreadContext));
            builder.AddMethod(new RequestDelegate(Request));
            IDacDataTarget = builder.Complete();

            builder = AddInterface(IID_IMetadataLocator);
            builder.AddMethod(new GetMetadataDelegate(GetMetadata));
            builder.Complete();
        }
Esempio n. 3
0
 internal DesktopRuntimeBase(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
     : base(info, dt, lib)
 {
     _heap        = new Lazy <DesktopGCHeap>(CreateHeap);
     _threads     = new Lazy <List <ClrThread> >(CreateThreadList);
     _appDomains  = new Lazy <DomainContainer>(CreateAppDomainList);
     _threadpool  = new Lazy <DesktopThreadPool>(CreateThreadPoolData);
     _moduleSizes = new Lazy <Dictionary <ulong, uint> >(() => _dataReader.EnumerateModules().ToDictionary(module => module.ImageBase, module => module.FileSize));
     _mscorlib    = new Lazy <ClrModule>(GetMscorlib);
 }
Esempio n. 4
0
        public RhRuntime(DataTargetImpl dt, DacLibrary lib)
            : base(dt, lib)
        {
            byte[] tmp = new byte[sizeof(int)];

            if (!Request(DacRequests.VERSION, null, tmp))
                throw new ClrDiagnosticsException("Failed to request dac version.", ClrDiagnosticsException.HR.DacError);

            m_dacRawVersion = BitConverter.ToInt32(tmp, 0);
            if (m_dacRawVersion != 10 && m_dacRawVersion != 11)
                throw new ClrDiagnosticsException("Unsupported dac version.", ClrDiagnosticsException.HR.DacError);
        }
Esempio n. 5
0
        public NativeRuntime(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
            : base(info, dt, lib)
        {
            byte[] tmp = new byte[sizeof(int)];

            if (!Request(DacRequests.VERSION, null, tmp))
            {
                throw new ClrDiagnosticsException("Failed to request dac version.", ClrDiagnosticsException.HR.DacError);
            }

            _dacRawVersion = BitConverter.ToInt32(tmp, 0);
            if (_dacRawVersion != 10 && _dacRawVersion != 11)
            {
                throw new ClrDiagnosticsException("Unsupported dac version.", ClrDiagnosticsException.HR.DacError);
            }
        }
Esempio n. 6
0
        public V45Runtime(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
            : base(info, dt, lib)
        {
            if (!GetCommonMethodTables(ref _commonMTs))
                throw new ClrDiagnosticsException("Could not request common MethodTable list.", ClrDiagnosticsException.HR.DacError);

            // Ensure the version of the dac API matches the one we expect.  (Same for both
            // v2 and v4 rtm.)
            byte[] tmp = new byte[sizeof(int)];

            if (!Request(DacRequests.VERSION, null, tmp))
                throw new ClrDiagnosticsException("Failed to request dac version.", ClrDiagnosticsException.HR.DacError);

            int v = BitConverter.ToInt32(tmp, 0);
            if (v != 9)
                throw new ClrDiagnosticsException("Unsupported dac version.", ClrDiagnosticsException.HR.DacError);
        }
Esempio n. 7
0
 internal DesktopRuntimeBase(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
     : base(info, dt, lib)
 {
 }
Esempio n. 8
0
 internal DesktopRuntimeBase(ClrInfo info, DataTargetImpl dt, DacLibrary lib)
     : base(info, dt, lib)
 {
 }
Esempio n. 9
0
 internal DesktopRuntimeBase(DataTargetImpl dt, DacLibrary lib)
     : base(dt, lib)
 {
 }