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