Skip to content

Proposal: Support memory reference breakpoints #102

@auott

Description

@auott

Memory reference breakpoints allow setting a breakpoint based off of memory reference previously provided by an adapter.

export interface Capabilities {
    // ...

    /** The debug adapter supports setting breakpoints based on instruction references. */
    supportsInstructionBreakpoints?: boolean;
}

/** 
 * 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 a memory reference breakpoint is hit, a 'stopped' event (with reason 'instruction breakpoint') is generated.
 * Clients should only call this request if the capability 'supportsInstructionBreakpoints' is true.
 */
export interface SetInstructionBreakpointsRequest extends Request {
    // command: 'setInstructionBreakpoints'
    arguments: SetInstructionBreakpointsArguments;
}

/** Arguments for 'setInstructionBreakpoints' request */
export interface SetInstructionBreakpointsArguments {
    /** The instruction references of the breakpoints */
    breakpoints: InstructionBreakpoint[];
}

/** Response to 'setInstructionBreakpoints' request */
export interface SetInstructionBreakpointsResponse extends Response {
    body: {
        /**
         * Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array.
         */
        breakpoints: Breakpoint[];
    }
}

/** Properties of a breakpoint passed to the setInstructionBreakpoints request */
export interface InstructionBreakpoint {
    /** 
    * The instruction reference of the breakpoint.
    * This should be a memory or instruction pointer reference from an EvaluateResponse, Variable, 
    * StackFrame, GotoTarget, or Breakpoint.
    */
    instructionReference: string;

    /** 
     * An optional offset from the instruction reference.
     * This can be negative.
     */
    offset?: int;

    /**
     * An optional expression for conditional breakpoints.
     * It is only honored by a debug adapter if the capability 'supportsConditionalBreakpoints' is true.
     */
    condition?: string;

    /**
     * An optional expression that controls how many hits of the breakpoint are ignored.
     * The backend is expected to interpret the expression as needed.
     * The attribute is only honored by a debug adapter if the capability 
     * 'supportsHitConditionalBreakpoints' is true.
     */
    hitCondition?: string;
}

export interface Breakpoint {
    // ...

    /** 
     * An optional memory reference where the breakpoint is located.
     */
    instructionReference?: string;

    /**
     * An optional offset from the instruction reference.
     */
     offset?: int;
}

CC: @andrewcrawley, @weinand

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions