@@ -377,49 +377,15 @@ void InitializeRequestHandler::operator()(
377377 // process and more.
378378 dap.event_thread = std::thread (EventThreadFunction, std::ref (dap));
379379
380- // The debug adapter supports the configurationDoneRequest.
381- body.try_emplace (" supportsConfigurationDoneRequest" , true );
382- // The debug adapter supports function breakpoints.
383- body.try_emplace (" supportsFunctionBreakpoints" , true );
384- // The debug adapter supports conditional breakpoints.
385- body.try_emplace (" supportsConditionalBreakpoints" , true );
386- // The debug adapter supports breakpoints that break execution after a
387- // specified number of hits.
388- body.try_emplace (" supportsHitConditionalBreakpoints" , true );
389- // The debug adapter supports a (side effect free) evaluate request for
390- // data hovers.
391- body.try_emplace (" supportsEvaluateForHovers" , true );
380+ llvm::StringMap<bool > capabilities = dap.GetCapabilities ();
381+ for (auto &kv : capabilities)
382+ body.try_emplace (kv.getKey (), kv.getValue ());
383+
392384 // Available filters or options for the setExceptionBreakpoints request.
393385 llvm::json::Array filters;
394- for (const auto &exc_bp : *dap.exception_breakpoints ) {
386+ for (const auto &exc_bp : *dap.exception_breakpoints )
395387 filters.emplace_back (CreateExceptionBreakpointFilter (exc_bp));
396- }
397388 body.try_emplace (" exceptionBreakpointFilters" , std::move (filters));
398- // The debug adapter supports launching a debugee in intergrated VSCode
399- // terminal.
400- body.try_emplace (" supportsRunInTerminalRequest" , true );
401- // The debug adapter supports stepping back via the stepBack and
402- // reverseContinue requests.
403- body.try_emplace (" supportsStepBack" , false );
404- // The debug adapter supports setting a variable to a value.
405- body.try_emplace (" supportsSetVariable" , true );
406- // The debug adapter supports restarting a frame.
407- body.try_emplace (" supportsRestartFrame" , false );
408- // The debug adapter supports the gotoTargetsRequest.
409- body.try_emplace (" supportsGotoTargetsRequest" , false );
410- // The debug adapter supports the stepInTargetsRequest.
411- body.try_emplace (" supportsStepInTargetsRequest" , true );
412- // The debug adapter supports the completions request.
413- body.try_emplace (" supportsCompletionsRequest" , true );
414- // The debug adapter supports the disassembly request.
415- body.try_emplace (" supportsDisassembleRequest" , true );
416- // The debug adapter supports the `breakpointLocations` request.
417- body.try_emplace (" supportsBreakpointLocationsRequest" , true );
418- // The debug adapter supports stepping granularities (argument `granularity`)
419- // for the stepping requests.
420- body.try_emplace (" supportsSteppingGranularity" , true );
421- // The debug adapter support for instruction breakpoint.
422- body.try_emplace (" supportsInstructionBreakpoints" , true );
423389
424390 llvm::json::Array completion_characters;
425391 completion_characters.emplace_back (" ." );
@@ -428,42 +394,6 @@ void InitializeRequestHandler::operator()(
428394 body.try_emplace (" completionTriggerCharacters" ,
429395 std::move (completion_characters));
430396
431- // The debug adapter supports the modules request.
432- body.try_emplace (" supportsModulesRequest" , true );
433- // The set of additional module information exposed by the debug adapter.
434- // body.try_emplace("additionalModuleColumns"] = ColumnDescriptor
435- // Checksum algorithms supported by the debug adapter.
436- // body.try_emplace("supportedChecksumAlgorithms"] = ChecksumAlgorithm
437- // The debug adapter supports the RestartRequest. In this case a client
438- // should not implement 'restart' by terminating and relaunching the adapter
439- // but by calling the RestartRequest.
440- body.try_emplace (" supportsRestartRequest" , true );
441- // The debug adapter supports 'exceptionOptions' on the
442- // setExceptionBreakpoints request.
443- body.try_emplace (" supportsExceptionOptions" , true );
444- // The debug adapter supports a 'format' attribute on the stackTraceRequest,
445- // variablesRequest, and evaluateRequest.
446- body.try_emplace (" supportsValueFormattingOptions" , true );
447- // The debug adapter supports the exceptionInfo request.
448- body.try_emplace (" supportsExceptionInfoRequest" , true );
449- // The debug adapter supports the 'terminateDebuggee' attribute on the
450- // 'disconnect' request.
451- body.try_emplace (" supportTerminateDebuggee" , true );
452- // The debug adapter supports the delayed loading of parts of the stack,
453- // which requires that both the 'startFrame' and 'levels' arguments and the
454- // 'totalFrames' result of the 'StackTrace' request are supported.
455- body.try_emplace (" supportsDelayedStackTraceLoading" , true );
456- // The debug adapter supports the 'loadedSources' request.
457- body.try_emplace (" supportsLoadedSourcesRequest" , false );
458- // The debug adapter supports sending progress reporting events.
459- body.try_emplace (" supportsProgressReporting" , true );
460- // The debug adapter supports 'logMessage' in breakpoint.
461- body.try_emplace (" supportsLogPoints" , true );
462- // The debug adapter supports data watchpoints.
463- body.try_emplace (" supportsDataBreakpoints" , true );
464- // The debug adapter supports the `readMemory` request.
465- body.try_emplace (" supportsReadMemoryRequest" , true );
466-
467397 // Put in non-DAP specification lldb specific information.
468398 llvm::json::Object lldb_json;
469399 lldb_json.try_emplace (" version" , dap.debugger .GetVersionString ());
0 commit comments