Exemplo n.º 1
0
        public DebuggerApi(WinDbgWrapper wrapper, TimeSpan operationTimeout = default(TimeSpan))
        {
            if (wrapper == null)
            {
                throw new ArgumentNullException(nameof(wrapper));
            }

            _wrapper = wrapper;
            _timeout = operationTimeout == default(TimeSpan) ? Defaults.Timeout : operationTimeout;
        }
Exemplo n.º 2
0
        private void InitializeDebugger(string debuggerEnginePath, string[] sources)
        {
            Action <string> loggerAction = (text) => SendEvent(new OutputEvent("stdout", text));

            _wrapper = new WinDbgWrapper(debuggerEnginePath, sources);
            _wrapper.BreakpointHit  += OnBreakpoint;
            _wrapper.ExceptionHit   += OnException;
            _wrapper.BreakHit       += OnBreak;
            _wrapper.Terminated     += OnTerminated;
            _wrapper.ProcessExited  += OnProcessExited;
            _wrapper.ThreadFinished += OnThreadFinished;
            _wrapper.ThreadStarted  += OnThreadStarted;

            _api = new DebuggerApi(_wrapper, Defaults.Timeout);
        }
Exemplo n.º 3
0
        private void OnTerminated(object sender, EventArgs e)
        {
            _wrapper.BreakHit       -= OnBreak;
            _wrapper.BreakpointHit  -= OnBreakpoint;
            _wrapper.ExceptionHit   -= OnException;
            _wrapper.ProcessExited  -= OnProcessExited;
            _wrapper.Terminated     -= OnTerminated;
            _wrapper.ThreadFinished -= OnThreadFinished;
            _wrapper.ThreadStarted  -= OnThreadStarted;
            _wrapper.Dispose();

            _wrapper = null;
            _api     = null;

            SendEvent(new TerminatedEvent());
        }