Beispiel #1
0
        public void Attach(int port)
        {
            LogProvider.Log("Attempting connection at port {0}...", port);
            MDS.VirtualMachineManager.DefaultTimeout = 500;
            vm = MDS.VirtualMachineManager.Connect(new IPEndPoint(IPAddress.Loopback, port));
            vm.EnableEvents(
                MDS.EventType.AppDomainCreate,
                MDS.EventType.AppDomainUnload,
                MDS.EventType.VMStart,
                MDS.EventType.VMDeath,
                MDS.EventType.VMDisconnect,
                MDS.EventType.AssemblyLoad,
                MDS.EventType.AssemblyUnload,
                MDS.EventType.ThreadStart,
                MDS.EventType.ThreadDeath
                );

            methodEntryRequest = new EventRequest(vm.CreateMethodEntryRequest());
            QueueUserWorkItem(EventLoop);
        }
        public void Connect()
        {
            WithErrorLogging(() =>
            {
                Trace("Attempting connection at port {0}...", _debuggerPort);

                _vm = VirtualMachineManager.Connect(new IPEndPoint(IPAddress.Loopback, _debuggerPort));
                _vm.Suspend();
                _vm.EnableEvents(
                    EventType.AssemblyLoad,
                    EventType.AssemblyUnload,
                    EventType.AppDomainUnload,
                    EventType.AppDomainCreate,
                    EventType.VMDeath,
                    EventType.VMDisconnect,
                    EventType.TypeLoad
                    );
                _methodEntryRequest = _vm.CreateMethodEntryRequest();
                StartEventLoop();
            });
        }
Beispiel #3
0
        public VirtualMachine()
            : base(null)
        {
            Factory.Register(
                location => new SdbBreakpoint(vm.CreateBreakpointRequest(location.Unwrap <MDS.Location> ()), location),
                (thread, stepType) =>
            {
                var request = vm.CreateStepRequest(thread.Unwrap <MDS.ThreadMirror>());
                switch (stepType)
                {
                case StepType.Into: request.Depth = MDS.StepDepth.Into; break;

                case StepType.Over: request.Depth = MDS.StepDepth.Over; break;

                case StepType.Out: request.Depth = MDS.StepDepth.Out; break;
                }
                return(Cache.Lookup <EventRequest>(request));
            },
                () => new EventRequest(vm.CreateMethodEntryRequest()),
                () => new EventRequest(vm.CreateMethodExitRequest()),
                (source, line) => new SdbLocation(source, line)
                );
        }
Beispiel #4
0
        public void Connect()
        {
            WithErrorLogging(() =>
            {
                Trace("Attempting connection at port {0}...", _debuggerPort);

                _vm = VirtualMachineManager.Connect(new IPEndPoint(IPAddress.Loopback, _debuggerPort));
                _vm.Suspend();
                _vm.EnableEvents(
                    EventType.AssemblyLoad,
                    EventType.AssemblyUnload,
                    EventType.AppDomainUnload,
                    EventType.AppDomainCreate,
                    EventType.VMDeath,
                    EventType.VMDisconnect,
                    EventType.TypeLoad
                    );
                _methodEntryRequest = _vm.CreateMethodEntryRequest();
                StartEventLoop();
            });
        }
Beispiel #5
0
        public void Attach(int port)
        {
            LogProvider.Log ("Attempting connection at port {0}...", port);
            vm = MDS.VirtualMachineManager.Connect (new IPEndPoint (IPAddress.Loopback, port));
            vm.EnableEvents (
                MDS.EventType.AppDomainCreate,
                MDS.EventType.AppDomainUnload,
                MDS.EventType.VMStart,
                MDS.EventType.VMDeath,
                MDS.EventType.VMDisconnect,
                MDS.EventType.AssemblyLoad,
                MDS.EventType.AssemblyUnload
            );

            methodEntryRequest = new EventRequest (vm.CreateMethodEntryRequest ());
            QueueUserWorkItem (EventLoop);
        }