ruby-dap 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +17 -3
  4. data/lib/dap.rb +4 -0
  5. data/lib/dap/attach_request_arguments.rb +2 -0
  6. data/lib/dap/base.rb +57 -6
  7. data/lib/dap/breakpoint.rb +11 -9
  8. data/lib/dap/breakpoint_event_body.rb +2 -1
  9. data/lib/dap/breakpoint_location.rb +6 -4
  10. data/lib/dap/breakpoint_locations_arguments.rb +5 -4
  11. data/lib/dap/breakpoint_locations_response_body.rb +2 -0
  12. data/lib/dap/cancel_arguments.rb +3 -2
  13. data/lib/dap/capabilities.rb +33 -32
  14. data/lib/dap/capabilities_event_body.rb +6 -0
  15. data/lib/dap/checksum.rb +2 -1
  16. data/lib/dap/checksum_algorithm.rb +1 -0
  17. data/lib/dap/column_descriptor.rb +8 -5
  18. data/lib/dap/completion_item.rb +8 -7
  19. data/lib/dap/completion_item_type.rb +2 -0
  20. data/lib/dap/completions_arguments.rb +5 -4
  21. data/lib/dap/completions_response_body.rb +1 -0
  22. data/lib/dap/continue_arguments.rb +2 -1
  23. data/lib/dap/continue_response_body.rb +2 -1
  24. data/lib/dap/continued_event_body.rb +7 -2
  25. data/lib/dap/data_breakpoint.rb +4 -3
  26. data/lib/dap/data_breakpoint_access_type.rb +1 -0
  27. data/lib/dap/data_breakpoint_info_arguments.rb +3 -2
  28. data/lib/dap/data_breakpoint_info_response_body.rb +3 -2
  29. data/lib/dap/disassemble_arguments.rb +6 -5
  30. data/lib/dap/disassemble_response_body.rb +1 -0
  31. data/lib/dap/disassembled_instruction.rb +9 -8
  32. data/lib/dap/disconnect_arguments.rb +3 -2
  33. data/lib/dap/encoding.rb +12 -1
  34. data/lib/dap/enum.rb +6 -0
  35. data/lib/dap/error_response_body.rb +1 -0
  36. data/lib/dap/evaluate_arguments.rb +4 -3
  37. data/lib/dap/evaluate_response_body.rb +7 -6
  38. data/lib/dap/event.rb +7 -0
  39. data/lib/dap/exception_break_mode.rb +6 -0
  40. data/lib/dap/exception_breakpoints_filter.rb +5 -3
  41. data/lib/dap/exception_details.rb +6 -5
  42. data/lib/dap/exception_info_arguments.rb +2 -1
  43. data/lib/dap/exception_info_response_body.rb +3 -2
  44. data/lib/dap/exception_options.rb +1 -0
  45. data/lib/dap/exception_path_segment.rb +6 -2
  46. data/lib/dap/exited_event_body.rb +2 -1
  47. data/lib/dap/function_breakpoint.rb +4 -3
  48. data/lib/dap/goto_arguments.rb +3 -2
  49. data/lib/dap/goto_target.rb +10 -7
  50. data/lib/dap/goto_targets_arguments.rb +3 -2
  51. data/lib/dap/goto_targets_response_body.rb +1 -0
  52. data/lib/dap/initialize_request_arguments.rb +14 -13
  53. data/lib/dap/instruction_breakpoint.rb +5 -4
  54. data/lib/dap/invalidated_event_body.rb +11 -3
  55. data/lib/dap/launch_request_arguments.rb +3 -1
  56. data/lib/dap/loaded_source_event_body.rb +3 -1
  57. data/lib/dap/loaded_sources_response_body.rb +1 -0
  58. data/lib/dap/message.rb +8 -7
  59. data/lib/dap/module.rb +17 -8
  60. data/lib/dap/module_event_body.rb +2 -1
  61. data/lib/dap/modules_arguments.rb +3 -2
  62. data/lib/dap/modules_response_body.rb +2 -1
  63. data/lib/dap/next_arguments.rb +2 -1
  64. data/lib/dap/output_event_body.rb +7 -6
  65. data/lib/dap/pause_arguments.rb +2 -1
  66. data/lib/dap/process_event_body.rb +7 -5
  67. data/lib/dap/progress_end_event_body.rb +5 -2
  68. data/lib/dap/progress_start_event_body.rb +12 -6
  69. data/lib/dap/progress_update_event_body.rb +9 -3
  70. data/lib/dap/protocol_message.rb +12 -1
  71. data/lib/dap/read_memory_arguments.rb +4 -3
  72. data/lib/dap/read_memory_response_body.rb +4 -3
  73. data/lib/dap/relation.rb +17 -1
  74. data/lib/dap/request.rb +7 -0
  75. data/lib/dap/response.rb +22 -1
  76. data/lib/dap/restart_frame_arguments.rb +2 -1
  77. data/lib/dap/reverse_continue_arguments.rb +2 -1
  78. data/lib/dap/run_in_terminal_request_arguments.rb +6 -5
  79. data/lib/dap/run_in_terminal_response_body.rb +3 -2
  80. data/lib/dap/scope.rb +12 -10
  81. data/lib/dap/scopes_arguments.rb +2 -1
  82. data/lib/dap/scopes_response_body.rb +1 -0
  83. data/lib/dap/set_breakpoints_arguments.rb +3 -2
  84. data/lib/dap/set_breakpoints_response_body.rb +5 -0
  85. data/lib/dap/set_data_breakpoints_arguments.rb +1 -0
  86. data/lib/dap/set_data_breakpoints_response_body.rb +2 -0
  87. data/lib/dap/set_exception_breakpoints_arguments.rb +2 -1
  88. data/lib/dap/set_expression_arguments.rb +4 -3
  89. data/lib/dap/set_expression_response_body.rb +6 -5
  90. data/lib/dap/set_function_breakpoints_arguments.rb +1 -0
  91. data/lib/dap/set_function_breakpoints_response_body.rb +2 -0
  92. data/lib/dap/set_instruction_breakpoints_arguments.rb +1 -0
  93. data/lib/dap/set_instruction_breakpoints_response_body.rb +1 -0
  94. data/lib/dap/set_variable_arguments.rb +4 -3
  95. data/lib/dap/set_variable_response_body.rb +6 -5
  96. data/lib/dap/source.rb +7 -5
  97. data/lib/dap/source_arguments.rb +2 -1
  98. data/lib/dap/source_breakpoint.rb +6 -5
  99. data/lib/dap/source_response_body.rb +3 -2
  100. data/lib/dap/stack_frame.rb +9 -8
  101. data/lib/dap/stack_frame_format.rb +8 -7
  102. data/lib/dap/stack_trace_arguments.rb +4 -3
  103. data/lib/dap/stack_trace_response_body.rb +2 -1
  104. data/lib/dap/step_back_arguments.rb +2 -1
  105. data/lib/dap/step_in_arguments.rb +3 -2
  106. data/lib/dap/step_in_target.rb +4 -2
  107. data/lib/dap/step_in_targets_arguments.rb +2 -1
  108. data/lib/dap/step_in_targets_response_body.rb +1 -0
  109. data/lib/dap/step_out_arguments.rb +2 -1
  110. data/lib/dap/stepping_granularity.rb +10 -0
  111. data/lib/dap/stopped_event_body.rb +9 -6
  112. data/lib/dap/terminate_arguments.rb +2 -1
  113. data/lib/dap/terminate_threads_arguments.rb +2 -1
  114. data/lib/dap/terminated_event_body.rb +2 -0
  115. data/lib/dap/thread.rb +3 -2
  116. data/lib/dap/thread_event_body.rb +3 -2
  117. data/lib/dap/threads_response_body.rb +1 -0
  118. data/lib/dap/value_format.rb +2 -1
  119. data/lib/dap/variable.rb +17 -8
  120. data/lib/dap/variable_presentation_hint.rb +5 -3
  121. data/lib/dap/variables_arguments.rb +5 -4
  122. data/lib/dap/variables_response_body.rb +1 -0
  123. metadata +2 -2
@@ -1,4 +1,5 @@
1
+ # Arguments for ‘stepInTargets’ request.
1
2
  class DAP::StepInTargetsArguments < DAP::Base
2
3
  # The stack frame for which to retrieve the possible stepIn targets.
3
- property :frameId
4
+ property :frameId, as: 'number'
4
5
  end
@@ -1,5 +1,6 @@
1
1
  require_relative 'step_in_target'
2
2
 
3
+ # Response to ‘stepInTargets’ request.
3
4
  class DAP::StepInTargetsResponseBody < DAP::Base
4
5
  # The possible stepIn targets of the specified source location.
5
6
  property :targets, as: many(DAP::StepInTarget)
@@ -1,8 +1,9 @@
1
1
  require_relative 'stepping_granularity'
2
2
 
3
+ # Arguments for ‘stepOut’ request.
3
4
  class DAP::StepOutArguments < DAP::Base
4
5
  # Execute 'stepOut' for this thread.
5
- property :threadId
6
+ property :threadId, as: 'number'
6
7
 
7
8
  # Optional granularity to step. If no granularity is specified, a granularity of 'statement' is assumed.
8
9
  property :granularity, required: false, as: DAP::SteppingGranularity
@@ -1,5 +1,15 @@
1
+ # The granularity of one ‘step’ in the stepping requests ‘next’, ‘stepIn’,
2
+ # ‘stepOut’, and ‘stepBack’.
1
3
  class DAP::SteppingGranularity < DAP::Enum
4
+ # The step should allow the program to run until the current statement has
5
+ # finished executing. The meaning of a statement is determined by the adapter
6
+ # and it may be considered equivalent to a line. For example ‘for(int i = 0; i
7
+ # < 10; i++)’ could be considered to have 3 statements ‘int i = 0’, ‘i < 10’,
8
+ # and ‘i++’
2
9
  STATEMENT = new('statement')
10
+ # The step should allow the program to run until the current source line has
11
+ # executed
3
12
  LINE = new('line')
13
+ # The step should allow one instruction to execute (e.g. one x86 instruction)
4
14
  INSTRUCTION = new('instruction')
5
15
  end
@@ -1,23 +1,26 @@
1
+ # The event indicates that the execution of the debuggee has stopped due to some
2
+ # condition. This can be caused by a break point previously set, a stepping
3
+ # request has completed, by executing a debugger statement etc.
1
4
  class DAP::StoppedEventBody < DAP::Base
2
5
  # The reason for the event.
3
6
  # For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated).
4
7
  # Values: 'step', 'breakpoint', 'exception', 'pause', 'entry', 'goto', 'function breakpoint', 'data breakpoint', 'instruction breakpoint', etc.
5
- property :reason # 'step' | 'breakpoint' | 'exception' | 'pause' | 'entry' | 'goto' | 'function breakpoint' | 'data breakpoint' | 'instruction breakpoint' | string
8
+ property :reason, as: 'string'
6
9
 
7
10
  # The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is and must be translated.
8
- property :description, required: false
11
+ property :description, required: false, as: 'string'
9
12
 
10
13
  # The thread which was stopped.
11
- property :threadId, required: false
14
+ property :threadId, required: false, as: 'number'
12
15
 
13
16
  # A value of true hints to the frontend that this event should not change the focus.
14
- property :preserveFocusHint, required: false
17
+ property :preserveFocusHint, required: false, as: 'boolean'
15
18
 
16
19
  # Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI.
17
- property :text, required: false
20
+ property :text, required: false, as: 'string'
18
21
 
19
22
  # If 'allThreadsStopped' is true, a debug adapter can announce that all threads have stopped.
20
23
  # - The client should use this information to enable that all threads can be expanded to access their stacktraces.
21
24
  # - If the attribute is missing or false, only the thread with the given threadId can be expanded.
22
- property :allThreadsStopped, required: false
25
+ property :allThreadsStopped, required: false, as: 'boolean'
23
26
  end
@@ -1,4 +1,5 @@
1
+ # Arguments for ‘terminate’ request.
1
2
  class DAP::TerminateArguments < DAP::Base
2
3
  # A value of true indicates that this 'terminate' request is part of a restart sequence.
3
- property :restart, required: false
4
+ property :restart, required: false, as: 'boolean'
4
5
  end
@@ -1,4 +1,5 @@
1
+ # Arguments for ‘terminateThreads’ request.
1
2
  class DAP::TerminateThreadsArguments < DAP::Base
2
3
  # Ids of threads to be terminated.
3
- property :threadIds, required: false
4
+ property :threadIds, required: false, as: 'number[]'
4
5
  end
@@ -1,3 +1,5 @@
1
+ # The event indicates that debugging of the debuggee has terminated. This does not
2
+ # mean that the debuggee itself has exited.
1
3
  class DAP::TerminatedEventBody < DAP::Base
2
4
  # A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session.
3
5
  # The value is not interpreted by the client and passed unmodified as an attribute '__restart' to the 'launch' and 'attach' requests.
@@ -1,7 +1,8 @@
1
+ # A Thread
1
2
  class DAP::Thread < DAP::Base
2
3
  # Unique identifier for the thread.
3
- property :id
4
+ property :id, as: 'number'
4
5
 
5
6
  # A name of the thread.
6
- property :name
7
+ property :name, as: 'string'
7
8
  end
@@ -1,8 +1,9 @@
1
+ # The event indicates that a thread has started or exited.
1
2
  class DAP::ThreadEventBody < DAP::Base
2
3
  # The reason for the event.
3
4
  # Values: 'started', 'exited', etc.
4
- property :reason # 'started' | 'exited' | string
5
+ property :reason, as: 'string'
5
6
 
6
7
  # The identifier of the thread.
7
- property :threadId
8
+ property :threadId, as: 'number'
8
9
  end
@@ -1,5 +1,6 @@
1
1
  require_relative 'thread'
2
2
 
3
+ # Response to ‘threads’ request.
3
4
  class DAP::ThreadsResponseBody < DAP::Base
4
5
  # All threads.
5
6
  property :threads, as: many(DAP::Thread)
@@ -1,4 +1,5 @@
1
+ # Provides formatting information for a value.
1
2
  class DAP::ValueFormat < DAP::Base
2
3
  # Display the value in hex.
3
- property :hex, required: false
4
+ property :hex, required: false, as: 'boolean'
4
5
  end
@@ -1,34 +1,43 @@
1
1
  require_relative 'variable_presentation_hint'
2
2
 
3
+ # A Variable is a name/value pair. Optionally a variable can have a ‘type’ that is
4
+ # shown if space permits or when hovering over the variable’s name. An optional
5
+ # ‘kind’ is used to render additional properties of the variable, e.g. different
6
+ # icons can be used to indicate that a variable is public or private. If the value
7
+ # is structured (has children), a handle is provided to retrieve the children with
8
+ # the VariablesRequest. If the number of named or indexed children is large, the
9
+ # numbers should be returned via the optional ‘namedVariables’ and
10
+ # ‘indexedVariables’ attributes. The client can use this optional information to
11
+ # present the children in a paged UI and fetch them in chunks.
3
12
  class DAP::Variable < DAP::Base
4
13
  # The variable's name.
5
- property :name
14
+ property :name, as: 'string'
6
15
 
7
16
  # The variable's value. This can be a multi-line text, e.g. for a function the body of a function.
8
- property :value
17
+ property :value, as: 'string'
9
18
 
10
19
  # The type of the variable's value. Typically shown in the UI when hovering over the value.
11
20
  # This attribute should only be returned by a debug adapter if the client has passed the value true for the 'supportsVariableType' capability of the 'initialize' request.
12
- property :type, required: false
21
+ property :type, required: false, as: 'string'
13
22
 
14
23
  # Properties of a variable that can be used to determine how to render the variable in the UI.
15
24
  property :presentationHint, required: false, as: DAP::VariablePresentationHint
16
25
 
17
26
  # Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value.
18
- property :evaluateName, required: false
27
+ property :evaluateName, required: false, as: 'string'
19
28
 
20
29
  # If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest.
21
- property :variablesReference
30
+ property :variablesReference, as: 'number'
22
31
 
23
32
  # The number of named child variables.
24
33
  # The client can use this optional information to present the children in a paged UI and fetch them in chunks.
25
- property :namedVariables, required: false
34
+ property :namedVariables, required: false, as: 'number'
26
35
 
27
36
  # The number of indexed child variables.
28
37
  # The client can use this optional information to present the children in a paged UI and fetch them in chunks.
29
- property :indexedVariables, required: false
38
+ property :indexedVariables, required: false, as: 'number'
30
39
 
31
40
  # Optional memory reference for the variable if the variable represents executable code, such as a function pointer.
32
41
  # This attribute is only required if the client has passed the value true for the 'supportsMemoryReferences' capability of the 'initialize' request.
33
- property :memoryReference, required: false
42
+ property :memoryReference, required: false, as: 'string'
34
43
  end
@@ -1,3 +1,5 @@
1
+ # Optional properties of a variable that can be used to determine how to render
2
+ # the variable in the UI.
1
3
  class DAP::VariablePresentationHint < DAP::Base
2
4
  # The kind of variable. Before introducing additional values, try to use the listed values.
3
5
  # Values:
@@ -14,7 +16,7 @@ class DAP::VariablePresentationHint < DAP::Base
14
16
  # adapter for rendering purposes, e.g. an index range for large arrays.
15
17
  # 'dataBreakpoint': Indicates that a data breakpoint is registered for the object.
16
18
  # etc.
17
- property :kind, required: false # 'property' | 'method' | 'class' | 'data' | 'event' | 'baseClass' | 'innerClass' | 'interface' | 'mostDerivedClass' | 'virtual' | 'dataBreakpoint' | string
19
+ property :kind, required: false, as: 'string'
18
20
 
19
21
  # Set of attributes represented as an array of strings. Before introducing additional values, try to use the listed values.
20
22
  # Values:
@@ -26,9 +28,9 @@ class DAP::VariablePresentationHint < DAP::Base
26
28
  # 'canHaveObjectId': Indicates that the object has an Object ID associated with it.
27
29
  # 'hasSideEffects': Indicates that the evaluation had side effects.
28
30
  # etc.
29
- property :attributes, required: false # ('static' | 'constant' | 'readOnly' | 'rawString' | 'hasObjectId' | 'canHaveObjectId' | 'hasSideEffects' | string)[]
31
+ property :attributes, required: false, as: 'string'
30
32
 
31
33
  # Visibility of variable. Before introducing additional values, try to use the listed values.
32
34
  # Values: 'public', 'private', 'protected', 'internal', 'final', etc.
33
- property :visibility, required: false # 'public' | 'private' | 'protected' | 'internal' | 'final' | string
35
+ property :visibility, required: false, as: 'string'
34
36
  end
@@ -1,18 +1,19 @@
1
1
  require_relative 'value_format'
2
2
 
3
+ # Arguments for ‘variables’ request.
3
4
  class DAP::VariablesArguments < DAP::Base
4
5
  # The Variable reference.
5
- property :variablesReference
6
+ property :variablesReference, as: 'number'
6
7
 
7
8
  # Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched.
8
9
  # Values: 'indexed', 'named', etc.
9
- property :filter, required: false # 'indexed' | 'named'
10
+ property :filter, required: false, as: 'string'
10
11
 
11
12
  # The index of the first variable to return; if omitted children start at 0.
12
- property :start, required: false
13
+ property :start, required: false, as: 'number'
13
14
 
14
15
  # The number of variables to return. If count is missing or 0, all variables are returned.
15
- property :count, required: false
16
+ property :count, required: false, as: 'number'
16
17
 
17
18
  # Specifies details on how to format the Variable values.
18
19
  # The attribute is only honored by a debug adapter if the capability 'supportsValueFormattingOptions' is true.
@@ -1,5 +1,6 @@
1
1
  require_relative 'variable'
2
2
 
3
+ # Response to ‘variables’ request.
3
4
  class DAP::VariablesResponseBody < DAP::Base
4
5
  # All (or a range) of variables for the given variable reference.
5
6
  property :variables, as: many(DAP::Variable)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-dap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Reesor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-09 00:00:00.000000000 Z
11
+ date: 2020-10-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Debug Adapter Protocol parsers and formatters
14
14
  email: ethan.reesor@gmail.com