Ejemplo n.º 1
0
        internal DebugProcess(DebugContext context, ICorDebugProcess process)
        {
            this.context = context;
            this.process = process;

            this.Process = Process.GetProcessById(process.GetID());
        }
Ejemplo n.º 2
0
        public static DebugContext ForRuntime(ICLRRuntimeInfo runtime)
        {
            var versionBuilder = new StringBuilder();
            var versionBuilderCapacity = versionBuilder.Capacity;

            runtime.GetVersionString(versionBuilder, ref versionBuilderCapacity);

            var version = versionBuilder.ToString();

            DebugContext debugContext;

            if (!DebugContexts.TryGetValue(version, out debugContext))
            {
                DebugContexts.Add(version, debugContext = new DebugContext(runtime));
            }

            return debugContext;
        }
Ejemplo n.º 3
0
        protected virtual void Dispose(bool disposeManagedObjects)
        {
            if (this.disposed || !disposeManagedObjects)
            {
                return;
            }

            this.Process.Dispose();
            this.Detach();

            this.context = null;
            this.process = null;

            this.disposed = true;
        }