private void InitializeDebugger(string[] symbolsPath = null) { var options = new WinDbgOptions(Const.PathToEngine, null, symbolsPath); _debugger = new WinDbgWrapper(options); _api = new DebuggerApi(_debugger); Environment.CurrentDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "..\\..\\test-debuggees\\rust\\src"); _debugger.ProcessExited += (a, b) => _hasExited = true; }
public WinDbgWrapper(WinDbgOptions options) { if (options == null) throw new ArgumentNullException(nameof(options)); if (!string.IsNullOrWhiteSpace(options.EnginePath)) NativeMethods.SetDllDirectory(Path.GetDirectoryName(options.EnginePath)); _options = options; _debuggerThread = new Thread(MainLoop); _debuggerThread.Start(_cancel.Token); State = new DebuggerState(); }
private void InitializeDebugger(WinDbgOptions options) { Action <string> loggerAction = (text) => SendEvent(new OutputEvent("stdout", text)); _wrapper = new WinDbgWrapper(options); _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); }