Example #1
0
        private void HandleLaunchRequest(DAPRequest request, DAPLaunchRequest launch)
        {
            Config  = launch.dbgOptions;
            ModUuid = launch.modUuid;

            if (!File.Exists(launch.debugInfoPath))
            {
                throw new RequestFailedException("Story debug file does not exist: " + launch.debugInfoPath);
            }

            DebugInfoPath = launch.debugInfoPath;

            try
            {
                DbgClient = new AsyncProtobufClient(launch.backendHost, launch.backendPort);
            }
            catch (SocketException e)
            {
                throw new RequestFailedException("Could not connect to Osiris backend server: " + e.Message);
            }

            DbgCli = new DebuggerClient(DbgClient, DebugInfo)
            {
                OnStoryLoaded               = this.OnStoryLoaded,
                OnDebugSessionEnded         = this.OnDebugSessionEnded,
                OnBackendInfo               = this.OnBackendInfo,
                OnBreakpointTriggered       = this.OnBreakpointTriggered,
                OnGlobalBreakpointTriggered = this.OnGlobalBreakpointTriggered,
                OnStorySyncData             = this.OnStorySyncData,
                OnStorySyncFinished         = this.OnStorySyncFinished,
                OnDebugOutput               = this.OnDebugOutput
            };
            if (LogStream != null)
            {
                DbgCli.EnableLogging(LogStream);
            }

            DbgCli.SendIdentify(DBGProtocolVersion);

            DbgThread = new Thread(new ThreadStart(DebugThreadMain));
            DbgThread.Start();

            Breakpoints = new BreakpointManager(DbgCli);

            var reply = new DAPLaunchResponse();

            Stream.SendReply(request, reply);

            var initializedEvt = new DAPInitializedEvent();

            Stream.SendEvent("initialized", initializedEvt);
        }
Example #2
0
        public DatabaseEnumerator(DebuggerClient dbgClient, DAPStream dap, StoryDebugInfo debugInfo, ValueFormatter formatter,
                                  EvaluationResultManager resultManager)
        {
            DebugInfo     = debugInfo;
            DAP           = dap;
            DbgClient     = dbgClient;
            Formatter     = formatter;
            ResultManager = resultManager;

            DbgClient.OnBeginDatabaseContents = this.OnBeginDatabaseContents;
            DbgClient.OnDatabaseRow           = this.OnDatabaseRow;
            DbgClient.OnEndDatabaseContents   = this.OnEndDatabaseContents;
        }
        public ExpressionEvaluator(StoryDebugInfo debugInfo, DAPStream dap, DebuggerClient dbgClient, ValueFormatter formatter,
                                   EvaluationResultManager results)
        {
            DebugInfo      = debugInfo;
            DbgClient      = dbgClient;
            DAP            = dap;
            DatabaseDumper = new DatabaseEnumerator(dbgClient, dap, debugInfo, formatter, results);
            EvalResults    = results;

            DbgClient.OnEvaluateRow      = this.OnEvaluateRow;
            DbgClient.OnEvaluateFinished = this.OnEvaluateFinished;

            MakeFunctionNameMap();
        }
 public BreakpointManager(DebuggerClient client)
 {
     DbgCli      = client;
     Breakpoints = new Dictionary <uint, Breakpoint>();
 }