13
13
#include " lldb/API/SBEvent.h"
14
14
#include " lldb/API/SBListener.h"
15
15
#include " lldb/API/SBStream.h"
16
+ #include " llvm/Support/raw_ostream.h"
16
17
17
18
using namespace lldb ;
18
19
@@ -377,49 +378,15 @@ void InitializeRequestHandler::operator()(
377
378
// process and more.
378
379
dap.event_thread = std::thread (EventThreadFunction, std::ref (dap));
379
380
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 );
381
+ llvm::StringMap<bool > capabilities = dap.GetCapabilities ();
382
+ for (auto &kv : capabilities)
383
+ body.try_emplace (kv.getKey (), kv.getValue ());
384
+
392
385
// Available filters or options for the setExceptionBreakpoints request.
393
386
llvm::json::Array filters;
394
- for (const auto &exc_bp : *dap.exception_breakpoints ) {
387
+ for (const auto &exc_bp : *dap.exception_breakpoints )
395
388
filters.emplace_back (CreateExceptionBreakpointFilter (exc_bp));
396
- }
397
389
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 );
423
390
424
391
llvm::json::Array completion_characters;
425
392
completion_characters.emplace_back (" ." );
@@ -428,42 +395,6 @@ void InitializeRequestHandler::operator()(
428
395
body.try_emplace (" completionTriggerCharacters" ,
429
396
std::move (completion_characters));
430
397
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
-
467
398
// Put in non-DAP specification lldb specific information.
468
399
llvm::json::Object lldb_json;
469
400
lldb_json.try_emplace (" version" , dap.debugger .GetVersionString ());
0 commit comments