示例#1
0
 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);
 }
示例#2
0
文件: Program.cs 项目: Norbyte/bg3se
        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());
                }
            }
        }