public DAPMessageHandler(DAPStream stream) { Stream = stream; Stream.MessageReceived += this.MessageReceived; ServerState = new ThreadState(); ServerState.Context = DbgContext.Server; ClientState = new ThreadState(); ClientState.Context = DbgContext.Client; Evaluator = new ExpressionEvaluator(this); }
static void Main(string[] args) { var currentPath = AppDomain.CurrentDomain.BaseDirectory; var logFile = new FileStream(currentPath + "\\DAP.log", FileMode.Create); var dap = new DAPStream(); dap.EnableLogging(logFile); var dapHandler = new DAPMessageHandler(dap); dapHandler.EnableLogging(logFile); try { dap.RunLoop(); } catch (Exception e) { using (var writer = new StreamWriter(logFile, Encoding.UTF8, 0x1000, true)) { writer.Write(e.ToString()); Console.WriteLine(e.ToString()); } } }