MCPcopy Create free account
hub / github.com/Norbyte/bg3se / HandleLaunchRequest

Method HandleLaunchRequest

LuaDebugger/DAPMessageHandler.cs:456–508  ·  view source on GitHub ↗
(DAPRequest request, DAPLaunchRequest launch)

Source from the content-addressed store, hash-verified

454 }
455
456 private void HandleLaunchRequest(DAPRequest request, DAPLaunchRequest launch)
457 {
458 Config = launch.dbgOptions;
459
460 if (launch.backendHost == null || launch.backendPort == 0)
461 {
462 throw new RequestFailedException("'backendHost' and 'backendPort' launch configuration variables must be set!");
463 }
464
465 if (Config == null)
466 {
467 Config = new DAPCustomConfiguration();
468 }
469
470 if (launch.noDebug)
471 {
472 throw new RequestFailedException("Cannot attach to game with debugging disabled");
473 }
474
475 try
476 {
477 DbgClient = new AsyncProtobufClient(launch.backendHost, launch.backendPort);
478 }
479 catch (SocketException e)
480 {
481 throw new RequestFailedException("Could not connect to Lua debugger backend: " + e.Message);
482 }
483
484 DbgCli = new DebuggerClient(DbgClient)
485 {
486 OnBackendConnected = this.OnBackendConnected,
487 OnBreakpointTriggered = this.OnBreakpointTriggered,
488 OnEvaluateFinished = Evaluator.OnEvaluateFinished,
489 OnContextUpdated = this.OnContextUpdated,
490 OnModInfo = this.OnModInfo,
491 OnDebugOutput = this.OnDebugOutput,
492 OnResults = this.OnResults,
493 OnDebuggerReady = this.OnDebuggerReady,
494 OnSourceResponse = this.OnSourceResponse,
495 OnGetVariablesFinished = Evaluator.OnGetVariablesFinished
496 };
497 if (LogStream != null)
498 {
499 DbgCli.EnableLogging(LogStream);
500 }
501
502 DbgCli.SendConnectRequest(DBGProtocolVersion);
503
504 DbgThread = new Thread(new ThreadStart(DebugThreadMain));
505 DbgThread.Start();
506
507 PendingLaunchRequest = request;
508 }
509
510 private void SendBreakpointUpdate()
511 {

Callers

nothing calls this directly

Calls 2

SendConnectRequestMethod · 0.80
EnableLoggingMethod · 0.45

Tested by

no test coverage detected