cmDebuggerProtocol.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <cm3p/cppdap/protocol.h>
  7. #include <cmcppdap/include/dap/optional.h>
  8. #include <cmcppdap/include/dap/typeof.h>
  9. #include <cmcppdap/include/dap/types.h>
  10. namespace dap {
  11. // Represents the cmake version.
  12. struct CMakeVersion : public InitializeResponse
  13. {
  14. // The major version number.
  15. integer major;
  16. // The minor version number.
  17. integer minor;
  18. // The patch number.
  19. integer patch;
  20. // The full version string.
  21. string full;
  22. };
  23. DAP_DECLARE_STRUCT_TYPEINFO(CMakeVersion);
  24. // Response to `initialize` request.
  25. struct CMakeInitializeResponse : public Response
  26. {
  27. // The set of additional module information exposed by the debug adapter.
  28. optional<array<ColumnDescriptor>> additionalModuleColumns;
  29. // The set of characters that should trigger completion in a REPL. If not
  30. // specified, the UI should assume the `.` character.
  31. optional<array<string>> completionTriggerCharacters;
  32. // Available exception filter options for the `setExceptionBreakpoints`
  33. // request.
  34. optional<array<ExceptionBreakpointsFilter>> exceptionBreakpointFilters;
  35. // The debug adapter supports the `suspendDebuggee` attribute on the
  36. // `disconnect` request.
  37. optional<boolean> supportSuspendDebuggee;
  38. // The debug adapter supports the `terminateDebuggee` attribute on the
  39. // `disconnect` request.
  40. optional<boolean> supportTerminateDebuggee;
  41. // Checksum algorithms supported by the debug adapter.
  42. optional<array<ChecksumAlgorithm>> supportedChecksumAlgorithms;
  43. // The debug adapter supports the `breakpointLocations` request.
  44. optional<boolean> supportsBreakpointLocationsRequest;
  45. // The debug adapter supports the `cancel` request.
  46. optional<boolean> supportsCancelRequest;
  47. // The debug adapter supports the `clipboard` context value in the `evaluate`
  48. // request.
  49. optional<boolean> supportsClipboardContext;
  50. // The debug adapter supports the `completions` request.
  51. optional<boolean> supportsCompletionsRequest;
  52. // The debug adapter supports conditional breakpoints.
  53. optional<boolean> supportsConditionalBreakpoints;
  54. // The debug adapter supports the `configurationDone` request.
  55. optional<boolean> supportsConfigurationDoneRequest;
  56. // The debug adapter supports data breakpoints.
  57. optional<boolean> supportsDataBreakpoints;
  58. // The debug adapter supports the delayed loading of parts of the stack,
  59. // which requires that both the `startFrame` and `levels` arguments and the
  60. // `totalFrames` result of the `stackTrace` request are supported.
  61. optional<boolean> supportsDelayedStackTraceLoading;
  62. // The debug adapter supports the `disassemble` request.
  63. optional<boolean> supportsDisassembleRequest;
  64. // The debug adapter supports a (side effect free) `evaluate` request for
  65. // data hovers.
  66. optional<boolean> supportsEvaluateForHovers;
  67. // The debug adapter supports `filterOptions` as an argument on the
  68. // `setExceptionBreakpoints` request.
  69. optional<boolean> supportsExceptionFilterOptions;
  70. // The debug adapter supports the `exceptionInfo` request.
  71. optional<boolean> supportsExceptionInfoRequest;
  72. // The debug adapter supports `exceptionOptions` on the
  73. // `setExceptionBreakpoints` request.
  74. optional<boolean> supportsExceptionOptions;
  75. // The debug adapter supports function breakpoints.
  76. optional<boolean> supportsFunctionBreakpoints;
  77. // The debug adapter supports the `gotoTargets` request.
  78. optional<boolean> supportsGotoTargetsRequest;
  79. // The debug adapter supports breakpoints that break execution after a
  80. // specified number of hits.
  81. optional<boolean> supportsHitConditionalBreakpoints;
  82. // The debug adapter supports adding breakpoints based on instruction
  83. // references.
  84. optional<boolean> supportsInstructionBreakpoints;
  85. // The debug adapter supports the `loadedSources` request.
  86. optional<boolean> supportsLoadedSourcesRequest;
  87. // The debug adapter supports log points by interpreting the `logMessage`
  88. // attribute of the `SourceBreakpoint`.
  89. optional<boolean> supportsLogPoints;
  90. // The debug adapter supports the `modules` request.
  91. optional<boolean> supportsModulesRequest;
  92. // The debug adapter supports the `readMemory` request.
  93. optional<boolean> supportsReadMemoryRequest;
  94. // The debug adapter supports restarting a frame.
  95. optional<boolean> supportsRestartFrame;
  96. // The debug adapter supports the `restart` request. In this case a client
  97. // should not implement `restart` by terminating and relaunching the adapter
  98. // but by calling the `restart` request.
  99. optional<boolean> supportsRestartRequest;
  100. // The debug adapter supports the `setExpression` request.
  101. optional<boolean> supportsSetExpression;
  102. // The debug adapter supports setting a variable to a value.
  103. optional<boolean> supportsSetVariable;
  104. // The debug adapter supports the `singleThread` property on the execution
  105. // requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`,
  106. // `stepBack`).
  107. optional<boolean> supportsSingleThreadExecutionRequests;
  108. // The debug adapter supports stepping back via the `stepBack` and
  109. // `reverseContinue` requests.
  110. optional<boolean> supportsStepBack;
  111. // The debug adapter supports the `stepInTargets` request.
  112. optional<boolean> supportsStepInTargetsRequest;
  113. // The debug adapter supports stepping granularities (argument `granularity`)
  114. // for the stepping requests.
  115. optional<boolean> supportsSteppingGranularity;
  116. // The debug adapter supports the `terminate` request.
  117. optional<boolean> supportsTerminateRequest;
  118. // The debug adapter supports the `terminateThreads` request.
  119. optional<boolean> supportsTerminateThreadsRequest;
  120. // The debug adapter supports a `format` attribute on the `stackTrace`,
  121. // `variables`, and `evaluate` requests.
  122. optional<boolean> supportsValueFormattingOptions;
  123. // The debug adapter supports the `writeMemory` request.
  124. optional<boolean> supportsWriteMemoryRequest;
  125. // The CMake version.
  126. CMakeVersion cmakeVersion;
  127. };
  128. DAP_DECLARE_STRUCT_TYPEINFO(CMakeInitializeResponse);
  129. // The `initialize` request is sent as the first request from the client to the
  130. // debug adapter in order to configure it with client capabilities and to
  131. // retrieve capabilities from the debug adapter. Until the debug adapter has
  132. // responded with an `initialize` response, the client must not send any
  133. // additional requests or events to the debug adapter. In addition the debug
  134. // adapter is not allowed to send any requests or events to the client until it
  135. // has responded with an `initialize` response. The `initialize` request may
  136. // only be sent once.
  137. struct CMakeInitializeRequest : public Request
  138. {
  139. using Response = CMakeInitializeResponse;
  140. // The ID of the debug adapter.
  141. string adapterID;
  142. // The ID of the client using this adapter.
  143. optional<string> clientID;
  144. // The human-readable name of the client using this adapter.
  145. optional<string> clientName;
  146. // If true all column numbers are 1-based (default).
  147. optional<boolean> columnsStartAt1;
  148. // If true all line numbers are 1-based (default).
  149. optional<boolean> linesStartAt1;
  150. // The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH.
  151. optional<string> locale;
  152. // Determines in what format paths are specified. The default is `path`,
  153. // which is the native format.
  154. //
  155. // May be one of the following enumeration values:
  156. // 'path', 'uri'
  157. optional<string> pathFormat;
  158. // Client supports the `argsCanBeInterpretedByShell` attribute on the
  159. // `runInTerminal` request.
  160. optional<boolean> supportsArgsCanBeInterpretedByShell;
  161. // Client supports the `invalidated` event.
  162. optional<boolean> supportsInvalidatedEvent;
  163. // Client supports the `memory` event.
  164. optional<boolean> supportsMemoryEvent;
  165. // Client supports memory references.
  166. optional<boolean> supportsMemoryReferences;
  167. // Client supports progress reporting.
  168. optional<boolean> supportsProgressReporting;
  169. // Client supports the `runInTerminal` request.
  170. optional<boolean> supportsRunInTerminalRequest;
  171. // Client supports the `startDebugging` request.
  172. optional<boolean> supportsStartDebuggingRequest;
  173. // Client supports the paging of variables.
  174. optional<boolean> supportsVariablePaging;
  175. // Client supports the `type` attribute for variables.
  176. optional<boolean> supportsVariableType;
  177. };
  178. DAP_DECLARE_STRUCT_TYPEINFO(CMakeInitializeRequest);
  179. } // namespace dap