debugger.proto

  1syntax = "proto3";
  2package zed.messages;
  3
  4import "core.proto";
  5import "buffer.proto";
  6
  7enum BreakpointState {
  8    Enabled = 0;
  9    Disabled = 1;
 10}
 11
 12message Breakpoint {
 13    Anchor position = 1;
 14    BreakpointState state = 2;
 15    reserved 3;
 16    optional string message = 4;
 17    optional string condition = 5;
 18    optional string hit_condition = 6;
 19    map<uint64, BreakpointSessionState> session_state = 7;
 20}
 21
 22message BreakpointSessionState {
 23    uint64 id = 1;
 24    bool verified = 2;
 25}
 26
 27message BreakpointsForFile {
 28    uint64 project_id = 1;
 29    string path = 2;
 30    repeated Breakpoint breakpoints = 3;
 31}
 32
 33message ToggleBreakpoint {
 34    uint64 project_id = 1;
 35    string path = 2;
 36    Breakpoint breakpoint = 3;
 37}
 38
 39enum DapThreadStatus {
 40    Running = 0;
 41    Stopped = 1;
 42    Exited = 2;
 43    Ended = 3;
 44}
 45
 46enum VariablesArgumentsFilter {
 47    Indexed = 0;
 48    Named = 1;
 49}
 50
 51message ValueFormat {
 52    optional bool hex = 1;
 53}
 54
 55message VariablesRequest {
 56    uint64 project_id = 1;
 57    uint64 client_id = 2;
 58    uint64 variables_reference = 3;
 59    optional VariablesArgumentsFilter filter = 4;
 60    optional uint64 start = 5;
 61    optional uint64 count = 6;
 62    optional ValueFormat format = 7;
 63}
 64
 65enum SteppingGranularity {
 66    Statement = 0;
 67    Line = 1;
 68    Instruction = 2;
 69}
 70
 71message DapLocationsRequest {
 72    uint64 project_id = 1;
 73    uint64 session_id = 2;
 74    uint64 location_reference = 3;
 75}
 76
 77message DapLocationsResponse {
 78    DapSource source = 1;
 79    uint64 line = 2;
 80    optional uint64 column = 3;
 81    optional uint64 end_line = 4;
 82    optional uint64 end_column = 5;
 83}
 84
 85enum DapEvaluateContext {
 86    Repl = 0;
 87    Watch = 1;
 88    Hover = 2;
 89    Clipboard = 3;
 90    EvaluateVariables = 4;
 91    EvaluateUnknown = 5;
 92}
 93
 94message DapEvaluateRequest {
 95    uint64 project_id = 1;
 96    uint64 client_id = 2;
 97    string expression = 3;
 98    optional uint64 frame_id = 4;
 99    optional DapEvaluateContext context = 5;
100}
101
102message DapEvaluateResponse {
103    string result = 1;
104    optional string evaluate_type = 2;
105    uint64 variable_reference = 3;
106    optional uint64 named_variables = 4;
107    optional uint64 indexed_variables = 5;
108    optional string memory_reference = 6;
109}
110
111
112message DapCompletionRequest {
113    uint64 project_id = 1;
114    uint64 client_id = 2;
115    string query = 3;
116    optional uint64 frame_id = 4;
117    optional uint64 line = 5;
118    uint64 column = 6;
119}
120
121enum DapCompletionItemType {
122    Method = 0;
123    Function = 1;
124    Constructor = 2;
125    Field = 3;
126    Variable = 4;
127    Class = 5;
128    Interface = 6;
129    Module = 7;
130    Property = 8;
131    Unit = 9;
132    Value = 10;
133    Enum = 11;
134    Keyword = 12;
135    Snippet = 13;
136    Text = 14;
137    Color = 15;
138    CompletionItemFile = 16;
139    Reference = 17;
140    Customcolor = 19;
141}
142
143message DapCompletionItem {
144    string label = 1;
145    optional string text = 2;
146    optional string sort_text = 3;
147    optional string detail = 4;
148    optional DapCompletionItemType typ = 5;
149    optional uint64 start = 6;
150    optional uint64 length = 7;
151    optional uint64 selection_start = 8;
152    optional uint64 selection_length = 9;
153}
154
155message DapCompletionResponse {
156    uint64 client_id = 1;
157    repeated DapCompletionItem completions = 2;
158}
159
160message DapScopesRequest {
161    uint64 project_id = 1;
162    uint64 client_id = 2;
163    uint64 stack_frame_id = 3;
164}
165
166message DapScopesResponse {
167    repeated DapScope scopes = 1;
168}
169
170message DapSetVariableValueRequest {
171    uint64 project_id = 1;
172    uint64 client_id = 2;
173    string name = 3;
174    string value = 4;
175    uint64 variables_reference = 5;
176}
177
178message DapSetVariableValueResponse {
179    uint64 client_id = 1;
180    string value = 2;
181    optional string variable_type = 3;
182    optional uint64 variables_reference = 4;
183    optional uint64 named_variables = 5;
184    optional uint64 indexed_variables = 6;
185    optional string memory_reference = 7;
186}
187
188message DapPauseRequest {
189    uint64 project_id = 1;
190    uint64 client_id = 2;
191    int64 thread_id = 3;
192}
193
194message DapDisconnectRequest {
195    uint64 project_id = 1;
196    uint64 client_id = 2;
197    optional bool restart = 3;
198    optional bool terminate_debuggee = 4;
199    optional bool suspend_debuggee = 5;
200}
201
202message DapTerminateThreadsRequest {
203    uint64 project_id = 1;
204    uint64 client_id = 2;
205    repeated int64 thread_ids = 3;
206}
207
208message DapThreadsRequest {
209    uint64 project_id = 1;
210    uint64 client_id = 2;
211}
212
213message DapThreadsResponse {
214    repeated DapThread threads = 1;
215}
216
217message DapTerminateRequest {
218    uint64 project_id = 1;
219    uint64 client_id = 2;
220    optional bool restart = 3;
221}
222
223message DapRestartRequest {
224    uint64 project_id = 1;
225    uint64 client_id = 2;
226    bytes raw_args = 3;
227}
228
229message DapRestartStackFrameRequest {
230    uint64 project_id = 1;
231    uint64 client_id = 2;
232    uint64 stack_frame_id = 3;
233}
234
235message ToggleIgnoreBreakpoints {
236    uint64 project_id = 1;
237    uint32 session_id = 2;
238}
239
240message IgnoreBreakpointState {
241    uint64 project_id = 1;
242    uint64 session_id = 2;
243    bool ignore = 3;
244}
245
246message DapNextRequest {
247    uint64 project_id = 1;
248    uint64 client_id = 2;
249    int64 thread_id = 3;
250    optional bool single_thread = 4;
251    optional SteppingGranularity granularity = 5;
252}
253
254message DapStepInRequest {
255    uint64 project_id = 1;
256    uint64 client_id = 2;
257    int64 thread_id = 3;
258    optional uint64 target_id = 4;
259    optional bool single_thread = 5;
260    optional SteppingGranularity granularity = 6;
261}
262
263message DapStepOutRequest {
264    uint64 project_id = 1;
265    uint64 client_id = 2;
266    int64 thread_id = 3;
267    optional bool single_thread = 4;
268    optional SteppingGranularity granularity = 5;
269}
270
271message DapStepBackRequest {
272    uint64 project_id = 1;
273    uint64 client_id = 2;
274    int64 thread_id = 3;
275    optional bool single_thread = 4;
276    optional SteppingGranularity granularity = 5;
277}
278
279message DapContinueRequest {
280    uint64 project_id = 1;
281    uint64 client_id = 2;
282    int64 thread_id = 3;
283    optional bool single_thread = 4;
284}
285
286message DapContinueResponse {
287    uint64 client_id = 1;
288    optional bool all_threads_continued = 2;
289}
290
291message DapModulesRequest {
292    uint64 project_id = 1;
293    uint64 client_id = 2;
294}
295
296message DapModulesResponse {
297    uint64 client_id = 1;
298    repeated DapModule modules = 2;
299}
300
301message DapLoadedSourcesRequest {
302    uint64 project_id = 1;
303    uint64 client_id = 2;
304}
305
306message DapLoadedSourcesResponse {
307    uint64 client_id = 1;
308    repeated DapSource sources = 2;
309}
310
311message DapStackTraceRequest {
312    uint64 project_id = 1;
313    uint64 client_id = 2;
314    int64 thread_id = 3;
315    optional uint64 start_frame = 4;
316    optional uint64 stack_trace_levels = 5;
317}
318
319message DapStackTraceResponse {
320    repeated DapStackFrame frames = 1;
321}
322
323message DapStackFrame {
324    uint64 id = 1;
325    string name = 2;
326    optional DapSource source = 3;
327    uint64 line = 4;
328    uint64 column = 5;
329    optional uint64 end_line = 6;
330    optional uint64 end_column = 7;
331    optional bool can_restart = 8;
332    optional string instruction_pointer_reference = 9;
333    optional DapModuleId module_id = 10;
334    optional DapStackPresentationHint presentation_hint = 11;
335}
336
337message DebuggerLoadedSourceList {
338    uint64 client_id = 1;
339    repeated DapSource sources = 2;
340}
341
342message DapVariables {
343    uint64 client_id = 1;
344    repeated DapVariable variables = 2;
345}
346
347// Remote Debugging: Dap Types
348message DapVariable {
349    string name = 1;
350    string value = 2;
351    optional string type = 3;
352    // optional DapVariablePresentationHint presentation_hint = 4;
353    optional string evaluate_name = 5;
354    uint64 variables_reference = 6;
355    optional uint64 named_variables = 7;
356    optional uint64 indexed_variables = 8;
357    optional string memory_reference = 9;
358}
359
360message DapThread {
361    int64 id = 1;
362    string name = 2;
363}
364
365message DapScope {
366    string name = 1;
367    optional DapScopePresentationHint presentation_hint = 2;
368    uint64 variables_reference = 3;
369    optional uint64 named_variables = 4;
370    optional uint64 indexed_variables = 5;
371    bool expensive = 6;
372    optional DapSource source = 7;
373    optional uint64 line = 8;
374    optional uint64 column = 9;
375    optional uint64 end_line = 10;
376    optional uint64 end_column = 11;
377}
378
379message DapSource {
380    optional string name = 1;
381    optional string path = 2;
382    optional uint64 source_reference = 3;
383    optional DapSourcePresentationHint presentation_hint = 4;
384    optional string origin = 5;
385    repeated DapSource sources = 6;
386    optional bytes adapter_data = 7;
387    repeated DapChecksum checksums = 8;
388}
389
390enum DapOutputCategory {
391    ConsoleOutput = 0;
392    Important = 1;
393    Stdout = 2;
394    Stderr = 3;
395    Unknown = 4;
396}
397
398enum DapOutputEventGroup {
399    Start = 0;
400    StartCollapsed = 1;
401    End = 2;
402}
403
404message DapOutputEvent {
405    string output = 1;
406    optional DapOutputCategory category = 2;
407    optional uint64 variables_reference = 3;
408    optional DapOutputEventGroup group = 4;
409    optional DapSource source = 5;
410    optional uint32 line = 6;
411    optional uint32 column = 7;
412}
413
414enum DapChecksumAlgorithm {
415    CHECKSUM_ALGORITHM_UNSPECIFIED = 0;
416    MD5 = 1;
417    SHA1 = 2;
418    SHA256 = 3;
419    TIMESTAMP = 4;
420}
421
422message DapChecksum {
423    DapChecksumAlgorithm algorithm = 1;
424    string checksum = 2;
425}
426
427enum DapScopePresentationHint {
428    Arguments = 0;
429    Locals = 1;
430    Registers = 2;
431    ReturnValue = 3;
432    ScopeUnknown = 4;
433}
434
435enum DapSourcePresentationHint {
436    SourceNormal = 0;
437    Emphasize = 1;
438    Deemphasize = 2;
439    SourceUnknown = 3;
440}
441
442enum DapStackPresentationHint {
443    StackNormal = 0;
444    Label = 1;
445    Subtle = 2;
446    StackUnknown = 3;
447}
448message DapModule {
449    DapModuleId id = 1;
450    string name = 2;
451    optional string path = 3;
452    optional bool is_optimized = 4;
453    optional bool is_user_code = 5;
454    optional string version = 6;
455    optional string symbol_status = 7;
456    optional string symbol_file_path = 8;
457    optional string date_time_stamp = 9;
458    optional string address_range = 10;
459}
460
461message DebugTaskDefinition {
462    string adapter = 1;
463    string label = 2;
464    string config = 3;
465    optional TcpHost tcp_connection = 4;
466}
467
468message TcpHost {
469    optional uint32 port = 1;
470    optional string host = 2;
471    optional uint64 timeout = 3;
472}
473
474message DebugLaunchRequest {
475    string program = 1;
476    optional string cwd = 2;
477    repeated string args = 3;
478    map<string, string> env = 4;
479}
480
481message DebugAttachRequest {
482    uint32 process_id = 1;
483}
484
485message DapModuleId {
486    oneof id {
487        uint32 number = 1;
488        string string = 2;
489    }
490}
491
492message GetDebugAdapterBinary {
493    uint64 project_id = 1;
494    uint64 session_id = 3;
495    DebugTaskDefinition definition = 2;
496    uint64 worktree_id = 4;
497}
498
499message DebugAdapterBinary {
500    optional string command = 1;
501    repeated string arguments = 2;
502    map<string, string> envs = 3;
503    optional string cwd = 4;
504    optional TcpHost connection = 5;
505    string configuration = 7;
506    LaunchType launch_type = 8;
507    enum LaunchType {
508        Attach = 0;
509        Launch = 1;
510    }
511}
512
513message RunDebugLocators {
514    uint64 project_id = 1;
515    SpawnInTerminal build_command = 2;
516    string locator = 3;
517}
518
519message DebugRequest {
520    oneof request {
521        DebugLaunchRequest debug_launch_request = 1;
522        DebugAttachRequest debug_attach_request = 2;
523    }
524}
525
526message DebugScenario {
527    string label = 1;
528    string adapter = 2;
529    reserved 3;
530    DebugRequest request = 4;
531    optional TcpHost connection = 5;
532    optional bool stop_on_entry = 6;
533    optional string configuration = 7;
534}
535
536message SpawnInTerminal {
537    string label = 1;
538    optional string command = 2;
539    repeated string args = 3;
540    map<string, string> env = 4;
541    optional string cwd = 5;
542}
543
544message LogToDebugConsole {
545    uint64 project_id = 1;
546    uint64 session_id = 2;
547    string message = 3;
548}