[Lldb-commits] [lldb] [lldb-dap] Enabling instruction breakpoint support to lldb-dap. (PR #105278)
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 21 14:04:30 PDT 2024
================
@@ -4046,6 +4048,181 @@ void request__testGetTargetBreakpoints(const llvm::json::Object &request) {
g_dap.SendJSON(llvm::json::Value(std::move(response)));
}
+// SetInstructionBreakpoints request; value of command field is
+// 'setInstructionBreakpoints'. Replaces all existing instruction breakpoints.
+// Typically, instruction breakpoints would be set from a disassembly window. To
+// clear all instruction breakpoints, specify an empty array. When an
+// instruction breakpoint is hit, a `stopped` event (with reason `instruction
+// breakpoint`) is generated. Clients should only call this request if the
+// corresponding capability `supportsInstructionBreakpoints` is true. interface
+// SetInstructionBreakpointsRequest extends Request {
+// command: 'setInstructionBreakpoints';
+// arguments: SetInstructionBreakpointsArguments;
+// }
+// interface SetInstructionBreakpointsArguments {
+// The instruction references of the breakpoints
+// breakpoints: InstructionBreakpoint[];
+// }
+// "InstructionBreakpoint ": {
+// "type": "object",
+// "description": "Properties of a breakpoint passed to the
+// setInstructionBreakpoints request.", "properties": {
+// "instructionReference": {
+// "type": "string",
+// "description": "The instruction reference of the breakpoint.
+// This should be a memory or instruction pointer reference from an
+// EvaluateResponse, Variable, StackFrame, GotoTarget, or Breakpoint."
+// },
+// "offset": {
+// "type": "number",
+// "description": "The offset from the instruction reference.
+// This can be negative."
+// },
+// "condition": {
+// "type": "string",
+// "description": "An expression for conditional breakpoints.
+// It is only honored by a debug adapter if the corresponding capability
+// supportsConditionalBreakpoints` is true."
+// },
+// "hitCondition": {
+// "type": "string",
+// "description": "An expression that controls how many hits of the
+// breakpoint are ignored. The debug adapter is expected to interpret the
+// expression as needed. The attribute is only honored by a debug adapter
+// if the corresponding capability `supportsHitConditionalBreakpoints` is
+// true."
+// },
+// }
+// interface SetInstructionBreakpointsResponse extends Response {
+// body: {
+// Information about the breakpoints. The array elements correspond to the
+// elements of the `breakpoints` array.
+// breakpoints: Breakpoint[];
+// };
+// }
+// Response to `setInstructionBreakpoints` request.
+// "Breakpoint": {
+// "type": "object",
+// "description": "Response to `setInstructionBreakpoints` request.",
+// "properties": {
+// "id": {
+// "type": "number",
+// "description": "The identifier for the breakpoint. It is needed if
+// breakpoint events are used to update or remove breakpoints."
+// },
+// "verified": {
+// "type": "boolean",
+// "description": "If true, the breakpoint could be set (but not
+// necessarily at the desired location."
+// },
+// "message": {
+// "type": "string",
+// "description": "A message about the state of the breakpoint.
+// This is shown to the user and can be used to explain why a breakpoint
+// could not be verified."
+// },
+// "source": {
+// "type": "Source",
+// "description": "The source where the breakpoint is located."
+// },
+// "line": {
+// "type": "number",
+// "description": "The start line of the actual range covered by the
+// breakpoint."
+// },
+// "column": {
+// "type": "number",
+// "description": "The start column of the actual range covered by the
+// breakpoint."
+// },
+// "endLine": {
+// "type": "number",
+// "description": "The end line of the actual range covered by the
+// breakpoint."
+// },
+// "endColumn": {
+// "type": "number",
+// "description": "The end column of the actual range covered by the
+// breakpoint. If no end line is given, then the end column is assumed to
+// be in the start line."
+// },
+// "instructionReference": {
+// "type": "string",
+// "description": "A memory reference to where the breakpoint is set."
+// },
+// "offset": {
+// "type": "number",
+// "description": "The offset from the instruction reference.
+// This can be negative."
+// },
+// },
+// "required": [ "id", "verified", "line"]
+// }
+void request_setInstructionBreakpoints(const llvm::json::Object &request) {
+ llvm::json::Object response;
+ llvm::json::Array response_breakpoints;
+ llvm::json::Object body;
+ FillResponse(request, response);
+
+ auto arguments = request.getObject("arguments");
+ auto breakpoints = arguments->getArray("breakpoints");
+
+ // It holds active instruction brealpoint list received from DAP.
----------------
walter-erquinigo wrote:
```suggestion
// It holds active instruction breakpoint list received from DAP.
```
https://github.com/llvm/llvm-project/pull/105278
More information about the lldb-commits
mailing list