dap

package
v0.0.0-...-d76c0ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidContentLength = errors.New("invalid content length")

ErrInvalidContentLength is the error returned by Decoder.Decode if the Content-Length header has an invalid value.

View Source
var ErrMissingContentLength = errors.New("missing content length")

ErrMissingContentLength is the error returned by Decoder.Decode if the Content-Length header is missing.

View Source
var ErrStop = errors.New("stop")

ErrStop is the error returned by a handler to indicate that the session should terminate.

Functions

This section is empty.

Types

type AttachRequestArguments

type AttachRequestArguments struct {
	Restart interface{} `json:"__restart,omitempty"`
}

type AttachResponseBody

type AttachResponseBody struct{}

type Boolean

type Boolean bool

func Bool

func Bool(v bool) *Boolean

Bool returns a pointer to v.

func (*Boolean) Eq

func (v *Boolean) Eq(u bool) bool

func (*Boolean) False

func (v *Boolean) False() bool

func (*Boolean) Get

func (v *Boolean) Get() bool

func (*Boolean) GetOr

func (v *Boolean) GetOr(u bool) bool

func (*Boolean) True

func (v *Boolean) True() bool

type Breakpoint

type Breakpoint struct {
	Column               *Integer `json:"column,omitempty"`
	EndColumn            *Integer `json:"endColumn,omitempty"`
	EndLine              *Integer `json:"endLine,omitempty"`
	Id                   *Integer `json:"id,omitempty"`
	InstructionReference *String  `json:"instructionReference,omitempty"`
	Line                 *Integer `json:"line,omitempty"`
	Message              *String  `json:"message,omitempty"`
	Offset               *Integer `json:"offset,omitempty"`
	Source               *Source  `json:"source,omitempty"`
	Verified             bool     `json:"verified"`
}

type BreakpointEventBody

type BreakpointEventBody struct {
	Breakpoint Breakpoint `json:"breakpoint"`
	Reason     string     `json:"reason"`
}

type BreakpointLocation

type BreakpointLocation struct {
	Column    *Integer `json:"column,omitempty"`
	EndColumn *Integer `json:"endColumn,omitempty"`
	EndLine   *Integer `json:"endLine,omitempty"`
	Line      int      `json:"line"`
}

type BreakpointLocationsArguments

type BreakpointLocationsArguments struct {
	Column    *Integer `json:"column,omitempty"`
	EndColumn *Integer `json:"endColumn,omitempty"`
	EndLine   *Integer `json:"endLine,omitempty"`
	Line      int      `json:"line"`
	Source    Source   `json:"source"`
}

type BreakpointLocationsResponseBody

type BreakpointLocationsResponseBody struct {
	Breakpoints []*BreakpointLocation `json:"breakpoints"`
}

type CancelArguments

type CancelArguments struct {
	ProgressId *String  `json:"progressId,omitempty"`
	RequestId  *Integer `json:"requestId,omitempty"`
}

type CancelResponseBody

type CancelResponseBody struct{}

type Capabilities

type Capabilities struct {
	AdditionalModuleColumns            []*ColumnDescriptor           `json:"additionalModuleColumns,omitempty"`
	CompletionTriggerCharacters        []string                      `json:"completionTriggerCharacters,omitempty"`
	ExceptionBreakpointFilters         []*ExceptionBreakpointsFilter `json:"exceptionBreakpointFilters,omitempty"`
	SupportSuspendDebuggee             *Boolean                      `json:"supportSuspendDebuggee,omitempty"`
	SupportTerminateDebuggee           *Boolean                      `json:"supportTerminateDebuggee,omitempty"`
	SupportedChecksumAlgorithms        []ChecksumAlgorithm           `json:"supportedChecksumAlgorithms,omitempty"`
	SupportsBreakpointLocationsRequest *Boolean                      `json:"supportsBreakpointLocationsRequest,omitempty"`
	SupportsCancelRequest              *Boolean                      `json:"supportsCancelRequest,omitempty"`
	SupportsClipboardContext           *Boolean                      `json:"supportsClipboardContext,omitempty"`
	SupportsCompletionsRequest         *Boolean                      `json:"supportsCompletionsRequest,omitempty"`
	SupportsConditionalBreakpoints     *Boolean                      `json:"supportsConditionalBreakpoints,omitempty"`
	SupportsConfigurationDoneRequest   *Boolean                      `json:"supportsConfigurationDoneRequest,omitempty"`
	SupportsDataBreakpoints            *Boolean                      `json:"supportsDataBreakpoints,omitempty"`
	SupportsDelayedStackTraceLoading   *Boolean                      `json:"supportsDelayedStackTraceLoading,omitempty"`
	SupportsDisassembleRequest         *Boolean                      `json:"supportsDisassembleRequest,omitempty"`
	SupportsEvaluateForHovers          *Boolean                      `json:"supportsEvaluateForHovers,omitempty"`
	SupportsExceptionFilterOptions     *Boolean                      `json:"supportsExceptionFilterOptions,omitempty"`
	SupportsExceptionInfoRequest       *Boolean                      `json:"supportsExceptionInfoRequest,omitempty"`
	SupportsExceptionOptions           *Boolean                      `json:"supportsExceptionOptions,omitempty"`
	SupportsFunctionBreakpoints        *Boolean                      `json:"supportsFunctionBreakpoints,omitempty"`
	SupportsGotoTargetsRequest         *Boolean                      `json:"supportsGotoTargetsRequest,omitempty"`
	SupportsHitConditionalBreakpoints  *Boolean                      `json:"supportsHitConditionalBreakpoints,omitempty"`
	SupportsInstructionBreakpoints     *Boolean                      `json:"supportsInstructionBreakpoints,omitempty"`
	SupportsLoadedSourcesRequest       *Boolean                      `json:"supportsLoadedSourcesRequest,omitempty"`
	SupportsLogPoints                  *Boolean                      `json:"supportsLogPoints,omitempty"`
	SupportsModulesRequest             *Boolean                      `json:"supportsModulesRequest,omitempty"`
	SupportsReadMemoryRequest          *Boolean                      `json:"supportsReadMemoryRequest,omitempty"`
	SupportsRestartFrame               *Boolean                      `json:"supportsRestartFrame,omitempty"`
	SupportsRestartRequest             *Boolean                      `json:"supportsRestartRequest,omitempty"`
	SupportsSetExpression              *Boolean                      `json:"supportsSetExpression,omitempty"`
	SupportsSetVariable                *Boolean                      `json:"supportsSetVariable,omitempty"`
	SupportsStepBack                   *Boolean                      `json:"supportsStepBack,omitempty"`
	SupportsStepInTargetsRequest       *Boolean                      `json:"supportsStepInTargetsRequest,omitempty"`
	SupportsSteppingGranularity        *Boolean                      `json:"supportsSteppingGranularity,omitempty"`
	SupportsTerminateRequest           *Boolean                      `json:"supportsTerminateRequest,omitempty"`
	SupportsTerminateThreadsRequest    *Boolean                      `json:"supportsTerminateThreadsRequest,omitempty"`
	SupportsValueFormattingOptions     *Boolean                      `json:"supportsValueFormattingOptions,omitempty"`
	SupportsWriteMemoryRequest         *Boolean                      `json:"supportsWriteMemoryRequest,omitempty"`
}

type CapabilitiesEventBody

type CapabilitiesEventBody struct {
	Capabilities Capabilities `json:"capabilities"`
}

type Checksum

type Checksum struct {
	Algorithm ChecksumAlgorithm `json:"algorithm"`
	Checksum  string            `json:"checksum"`
}

type ChecksumAlgorithm

type ChecksumAlgorithm string
const (
	ChecksumAlgorithm_MD5       ChecksumAlgorithm = "MD5"
	ChecksumAlgorithm_SHA1      ChecksumAlgorithm = "SHA1"
	ChecksumAlgorithm_SHA256    ChecksumAlgorithm = "SHA256"
	ChecksumAlgorithm_Timestamp ChecksumAlgorithm = "timestamp"
)

type ColumnDescriptor

type ColumnDescriptor struct {
	AttributeName string   `json:"attributeName"`
	Format        *String  `json:"format,omitempty"`
	Label         string   `json:"label"`
	Type          *String  `json:"type,omitempty"`
	Width         *Integer `json:"width,omitempty"`
}

type ColumnDescriptorType

type ColumnDescriptorType string
const (
	ColumnDescriptorType_String           ColumnDescriptorType = "string"
	ColumnDescriptorType_Number           ColumnDescriptorType = "number"
	ColumnDescriptorType_Boolean          ColumnDescriptorType = "boolean"
	ColumnDescriptorType_UnixTimestampUTC ColumnDescriptorType = "unixTimestampUTC"
)

type CompletionItem

type CompletionItem struct {
	Label           string   `json:"label"`
	Length          *Integer `json:"length,omitempty"`
	SelectionLength *Integer `json:"selectionLength,omitempty"`
	SelectionStart  *Integer `json:"selectionStart,omitempty"`
	SortText        *String  `json:"sortText,omitempty"`
	Start           *Integer `json:"start,omitempty"`
	Text            *String  `json:"text,omitempty"`
	Type            *String  `json:"type,omitempty"`
}

type CompletionItemType

type CompletionItemType string
const (
	CompletionItemType_Method      CompletionItemType = "method"
	CompletionItemType_Function    CompletionItemType = "function"
	CompletionItemType_Constructor CompletionItemType = "constructor"
	CompletionItemType_Field       CompletionItemType = "field"
	CompletionItemType_Variable    CompletionItemType = "variable"
	CompletionItemType_Class       CompletionItemType = "class"
	CompletionItemType_Interface   CompletionItemType = "interface"
	CompletionItemType_Module      CompletionItemType = "module"
	CompletionItemType_Property    CompletionItemType = "property"
	CompletionItemType_Unit        CompletionItemType = "unit"
	CompletionItemType_Value       CompletionItemType = "value"
	CompletionItemType_Enum        CompletionItemType = "enum"
	CompletionItemType_Keyword     CompletionItemType = "keyword"
	CompletionItemType_Snippet     CompletionItemType = "snippet"
	CompletionItemType_Text        CompletionItemType = "text"
	CompletionItemType_Color       CompletionItemType = "color"
	CompletionItemType_File        CompletionItemType = "file"
	CompletionItemType_Reference   CompletionItemType = "reference"
	CompletionItemType_Customcolor CompletionItemType = "customcolor"
)

type CompletionsArguments

type CompletionsArguments struct {
	Column  int      `json:"column"`
	FrameId *Integer `json:"frameId,omitempty"`
	Line    *Integer `json:"line,omitempty"`
	Text    string   `json:"text"`
}

type CompletionsResponseBody

type CompletionsResponseBody struct {
	Targets []*CompletionItem `json:"targets"`
}

type ConfigurationDoneArguments

type ConfigurationDoneArguments struct{}

type ConfigurationDoneResponseBody

type ConfigurationDoneResponseBody struct{}

type ContinueArguments

type ContinueArguments struct {
	ThreadId int `json:"threadId"`
}

type ContinueResponseBody

type ContinueResponseBody struct {
	AllThreadsContinued *Boolean `json:"allThreadsContinued,omitempty"`
}

type ContinuedEventBody

type ContinuedEventBody struct {
	AllThreadsContinued *Boolean `json:"allThreadsContinued,omitempty"`
	ThreadId            int      `json:"threadId"`
}

type DataBreakpoint

type DataBreakpoint struct {
	AccessType   *String `json:"accessType,omitempty"`
	Condition    *String `json:"condition,omitempty"`
	DataId       string  `json:"dataId"`
	HitCondition *String `json:"hitCondition,omitempty"`
}

type DataBreakpointAccessType

type DataBreakpointAccessType string
const (
	DataBreakpointAccessType_Read      DataBreakpointAccessType = "read"
	DataBreakpointAccessType_Write     DataBreakpointAccessType = "write"
	DataBreakpointAccessType_ReadWrite DataBreakpointAccessType = "readWrite"
)

type DataBreakpointInfoArguments

type DataBreakpointInfoArguments struct {
	Name               string   `json:"name"`
	VariablesReference *Integer `json:"variablesReference,omitempty"`
}

type DataBreakpointInfoResponseBody

type DataBreakpointInfoResponseBody struct {
	AccessTypes []DataBreakpointAccessType `json:"accessTypes,omitempty"`
	CanPersist  *Boolean                   `json:"canPersist,omitempty"`
	DataId      interface{}                `json:"dataId"`
	Description string                     `json:"description"`
}

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder unmarshalls DAP messages.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a new decoder that uses the given reader.

func (*Decoder) Decode

func (c *Decoder) Decode() (IProtocolMessage, error)

Decode unmarshalls a DAP message. Decode guarantees that the arguments/body of a successfully decoded request, response, or event will match the command/event field.

Decode returns ErrInvalidContentLength if the Content-Length header has an invalid value. Decode returns ErrMissingContentLength if the Content-Length header is missing.

type DisassembleArguments

type DisassembleArguments struct {
	InstructionCount  int      `json:"instructionCount"`
	InstructionOffset *Integer `json:"instructionOffset,omitempty"`
	MemoryReference   string   `json:"memoryReference"`
	Offset            *Integer `json:"offset,omitempty"`
	ResolveSymbols    *Boolean `json:"resolveSymbols,omitempty"`
}

type DisassembleResponseBody

type DisassembleResponseBody struct {
	Instructions []*DisassembledInstruction `json:"instructions"`
}

type DisassembledInstruction

type DisassembledInstruction struct {
	Address          string   `json:"address"`
	Column           *Integer `json:"column,omitempty"`
	EndColumn        *Integer `json:"endColumn,omitempty"`
	EndLine          *Integer `json:"endLine,omitempty"`
	Instruction      string   `json:"instruction"`
	InstructionBytes *String  `json:"instructionBytes,omitempty"`
	Line             *Integer `json:"line,omitempty"`
	Location         *Source  `json:"location,omitempty"`
	Symbol           *String  `json:"symbol,omitempty"`
}

type DisconnectArguments

type DisconnectArguments struct {
	Restart           *Boolean `json:"restart,omitempty"`
	SuspendDebuggee   *Boolean `json:"suspendDebuggee,omitempty"`
	TerminateDebuggee *Boolean `json:"terminateDebuggee,omitempty"`
}

type DisconnectResponseBody

type DisconnectResponseBody struct{}

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder marshalls DAP messages.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new encoder that uses the given writer.

func (*Encoder) Encode

func (c *Encoder) Encode(msg IProtocolMessage) error

Encode marshalls a DAP message.

Encode will fail if seq has not been set. Encode will fail if the arguments/body of a request, response, or event does not match its command/event field.

type ErrorResponseBody

type ErrorResponseBody struct {
	Error *Message `json:"error,omitempty"`
}

type EvaluateArguments

type EvaluateArguments struct {
	Context    *String      `json:"context,omitempty"`
	Expression string       `json:"expression"`
	Format     *ValueFormat `json:"format,omitempty"`
	FrameId    *Integer     `json:"frameId,omitempty"`
}

type EvaluateResponseBody

type EvaluateResponseBody struct {
	IndexedVariables   *Integer                  `json:"indexedVariables,omitempty"`
	MemoryReference    *String                   `json:"memoryReference,omitempty"`
	NamedVariables     *Integer                  `json:"namedVariables,omitempty"`
	PresentationHint   *VariablePresentationHint `json:"presentationHint,omitempty"`
	Result             string                    `json:"result"`
	Type               *String                   `json:"type,omitempty"`
	VariablesReference int                       `json:"variablesReference"`
}

type Event

type Event struct {
	ProtocolMessage
	Event string    `json:"event"`
	Body  EventBody `json:"body,omitempty"`
}

func (*Event) MarshalJSON

func (m *Event) MarshalJSON() ([]byte, error)

MarshalJSON marshalls the event to JSON.

func (*Event) UnmarshalJSON

func (m *Event) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls the event from JSON.

type EventBody

type EventBody interface {
	// contains filtered or unexported methods
}

type ExceptionBreakMode

type ExceptionBreakMode string
const (
	ExceptionBreakMode_Never         ExceptionBreakMode = "never"
	ExceptionBreakMode_Always        ExceptionBreakMode = "always"
	ExceptionBreakMode_Unhandled     ExceptionBreakMode = "unhandled"
	ExceptionBreakMode_UserUnhandled ExceptionBreakMode = "userUnhandled"
)

type ExceptionBreakpointsFilter

type ExceptionBreakpointsFilter struct {
	ConditionDescription *String  `json:"conditionDescription,omitempty"`
	Default              *Boolean `json:"default,omitempty"`
	Description          *String  `json:"description,omitempty"`
	Filter               string   `json:"filter"`
	Label                string   `json:"label"`
	SupportsCondition    *Boolean `json:"supportsCondition,omitempty"`
}

type ExceptionDetails

type ExceptionDetails struct {
	EvaluateName   *String             `json:"evaluateName,omitempty"`
	FullTypeName   *String             `json:"fullTypeName,omitempty"`
	InnerException []*ExceptionDetails `json:"innerException,omitempty"`
	Message        *String             `json:"message,omitempty"`
	StackTrace     *String             `json:"stackTrace,omitempty"`
	TypeName       *String             `json:"typeName,omitempty"`
}

type ExceptionFilterOptions

type ExceptionFilterOptions struct {
	Condition *String `json:"condition,omitempty"`
	FilterId  string  `json:"filterId"`
}

type ExceptionInfoArguments

type ExceptionInfoArguments struct {
	ThreadId int `json:"threadId"`
}

type ExceptionInfoResponseBody

type ExceptionInfoResponseBody struct {
	BreakMode   ExceptionBreakMode `json:"breakMode"`
	Description *String            `json:"description,omitempty"`
	Details     *ExceptionDetails  `json:"details,omitempty"`
	ExceptionId string             `json:"exceptionId"`
}

type ExceptionOptions

type ExceptionOptions struct {
	BreakMode ExceptionBreakMode      `json:"breakMode"`
	Path      []*ExceptionPathSegment `json:"path,omitempty"`
}

type ExceptionPathSegment

type ExceptionPathSegment struct {
	Names  []string `json:"names"`
	Negate *Boolean `json:"negate,omitempty"`
}

type ExitedEventBody

type ExitedEventBody struct {
	ExitCode int `json:"exitCode"`
}

type FunctionBreakpoint

type FunctionBreakpoint struct {
	Condition    *String `json:"condition,omitempty"`
	HitCondition *String `json:"hitCondition,omitempty"`
	Name         string  `json:"name"`
}

type GotoArguments

type GotoArguments struct {
	TargetId int `json:"targetId"`
	ThreadId int `json:"threadId"`
}

type GotoResponseBody

type GotoResponseBody struct{}

type GotoTarget

type GotoTarget struct {
	Column                      *Integer `json:"column,omitempty"`
	EndColumn                   *Integer `json:"endColumn,omitempty"`
	EndLine                     *Integer `json:"endLine,omitempty"`
	Id                          int      `json:"id"`
	InstructionPointerReference *String  `json:"instructionPointerReference,omitempty"`
	Label                       string   `json:"label"`
	Line                        int      `json:"line"`
}

type GotoTargetsArguments

type GotoTargetsArguments struct {
	Column *Integer `json:"column,omitempty"`
	Line   int      `json:"line"`
	Source Source   `json:"source"`
}

type GotoTargetsResponseBody

type GotoTargetsResponseBody struct {
	Targets []*GotoTarget `json:"targets"`
}

type Handler

type Handler interface {
	// Initialize Called when the DAP session begins.
	Initialize(*Session, *InitializeRequestArguments) (*Capabilities, error)

	// Process Called for each received DAP message. Returning an error will terminate the session.
	Process(IProtocolMessage) error

	// Terminate Called when the DAP session ends.
	Terminate()
}

Handler handles DAP events.

type IProtocolMessage

type IProtocolMessage interface {
	// contains filtered or unexported methods
}

IProtocolMessage is a DAP protocol message.

type InitializeRequestArguments

type InitializeRequestArguments struct {
	AdapterID                    string   `json:"adapterID"`
	ClientID                     *String  `json:"clientID,omitempty"`
	ClientName                   *String  `json:"clientName,omitempty"`
	ColumnsStartAt1              *Boolean `json:"columnsStartAt1,omitempty"`
	LinesStartAt1                *Boolean `json:"linesStartAt1,omitempty"`
	Locale                       *String  `json:"locale,omitempty"`
	PathFormat                   *String  `json:"pathFormat,omitempty"`
	SupportsInvalidatedEvent     *Boolean `json:"supportsInvalidatedEvent,omitempty"`
	SupportsMemoryReferences     *Boolean `json:"supportsMemoryReferences,omitempty"`
	SupportsProgressReporting    *Boolean `json:"supportsProgressReporting,omitempty"`
	SupportsRunInTerminalRequest *Boolean `json:"supportsRunInTerminalRequest,omitempty"`
	SupportsVariablePaging       *Boolean `json:"supportsVariablePaging,omitempty"`
	SupportsVariableType         *Boolean `json:"supportsVariableType,omitempty"`
}

type InitializedEventBody

type InitializedEventBody struct{}

type InstructionBreakpoint

type InstructionBreakpoint struct {
	Condition            *String  `json:"condition,omitempty"`
	HitCondition         *String  `json:"hitCondition,omitempty"`
	InstructionReference string   `json:"instructionReference"`
	Offset               *Integer `json:"offset,omitempty"`
}

type Integer

type Integer int

func Int

func Int(v int) *Integer

Int returns a pointer to v.

func (*Integer) Eq

func (v *Integer) Eq(u int) bool

func (*Integer) Get

func (v *Integer) Get() int

func (*Integer) GetOr

func (v *Integer) GetOr(u int) int

type InvalidatedEventBody

type InvalidatedEventBody struct {
	Areas        []string `json:"areas,omitempty"`
	StackFrameId *Integer `json:"stackFrameId,omitempty"`
	ThreadId     *Integer `json:"threadId,omitempty"`
}

type LaunchRequestArguments

type LaunchRequestArguments struct {
	NoDebug *Boolean    `json:"noDebug,omitempty"`
	Restart interface{} `json:"__restart,omitempty"`
}

type LaunchResponseBody

type LaunchResponseBody struct{}

type LoadedSourceEventBody

type LoadedSourceEventBody struct {
	Reason LoadedSourceEventBodyReason `json:"reason"`
	Source Source                      `json:"source"`
}

type LoadedSourceEventBodyReason

type LoadedSourceEventBodyReason string
const (
	LoadedSourceEventBodyReason_New     LoadedSourceEventBodyReason = "new"
	LoadedSourceEventBodyReason_Changed LoadedSourceEventBodyReason = "changed"
	LoadedSourceEventBodyReason_Removed LoadedSourceEventBodyReason = "removed"
)

type LoadedSourcesArguments

type LoadedSourcesArguments struct{}

type LoadedSourcesResponseBody

type LoadedSourcesResponseBody struct {
	Sources []*Source `json:"sources"`
}

type Message

type Message struct {
	Format        string            `json:"format"`
	Id            int               `json:"id"`
	SendTelemetry *Boolean          `json:"sendTelemetry,omitempty"`
	ShowUser      *Boolean          `json:"showUser,omitempty"`
	Url           *String           `json:"url,omitempty"`
	UrlLabel      *String           `json:"urlLabel,omitempty"`
	Variables     map[string]string `json:"variables,omitempty"`
}

type Module

type Module struct {
	AddressRange   *String     `json:"addressRange,omitempty"`
	DateTimeStamp  *String     `json:"dateTimeStamp,omitempty"`
	Id             interface{} `json:"id"`
	IsOptimized    *Boolean    `json:"isOptimized,omitempty"`
	IsUserCode     *Boolean    `json:"isUserCode,omitempty"`
	Name           string      `json:"name"`
	Path           *String     `json:"path,omitempty"`
	SymbolFilePath *String     `json:"symbolFilePath,omitempty"`
	SymbolStatus   *String     `json:"symbolStatus,omitempty"`
	Version        *String     `json:"version,omitempty"`
}

type ModuleEventBody

type ModuleEventBody struct {
	Module Module                `json:"module"`
	Reason ModuleEventBodyReason `json:"reason"`
}

type ModuleEventBodyReason

type ModuleEventBodyReason string
const (
	ModuleEventBodyReason_New     ModuleEventBodyReason = "new"
	ModuleEventBodyReason_Changed ModuleEventBodyReason = "changed"
	ModuleEventBodyReason_Removed ModuleEventBodyReason = "removed"
)

type ModulesArguments

type ModulesArguments struct {
	ModuleCount *Integer `json:"moduleCount,omitempty"`
	StartModule *Integer `json:"startModule,omitempty"`
}

type ModulesResponseBody

type ModulesResponseBody struct {
	Modules      []*Module `json:"modules"`
	TotalModules *Integer  `json:"totalModules,omitempty"`
}

type ModulesViewDescriptor

type ModulesViewDescriptor struct {
	Columns []*ColumnDescriptor `json:"columns"`
}

type NextArguments

type NextArguments struct {
	Granularity *String `json:"granularity,omitempty"`
	ThreadId    int     `json:"threadId"`
}

type NextResponseBody

type NextResponseBody struct{}

type Number

type Number float64

func Num

func Num(v float64) *Number

Num returns a pointer to v.

func (*Number) Eq

func (v *Number) Eq(u float64) bool

func (*Number) Get

func (v *Number) Get() float64

func (*Number) GetOr

func (v *Number) GetOr(u float64) float64

type OutputEventBody

type OutputEventBody struct {
	Category           *String     `json:"category,omitempty"`
	Column             *Integer    `json:"column,omitempty"`
	Data               interface{} `json:"data,omitempty"`
	Group              *String     `json:"group,omitempty"`
	Line               *Integer    `json:"line,omitempty"`
	Output             string      `json:"output"`
	Source             *Source     `json:"source,omitempty"`
	VariablesReference *Integer    `json:"variablesReference,omitempty"`
}

type OutputEventBodyGroup

type OutputEventBodyGroup string
const (
	OutputEventBodyGroup_Start          OutputEventBodyGroup = "start"
	OutputEventBodyGroup_StartCollapsed OutputEventBodyGroup = "startCollapsed"
	OutputEventBodyGroup_End            OutputEventBodyGroup = "end"
)

type PauseArguments

type PauseArguments struct {
	ThreadId int `json:"threadId"`
}

type PauseResponseBody

type PauseResponseBody struct{}

type ProcessEventBody

type ProcessEventBody struct {
	IsLocalProcess  *Boolean `json:"isLocalProcess,omitempty"`
	Name            string   `json:"name"`
	PointerSize     *Integer `json:"pointerSize,omitempty"`
	StartMethod     *String  `json:"startMethod,omitempty"`
	SystemProcessId *Integer `json:"systemProcessId,omitempty"`
}

type ProcessEventBodyStartMethod

type ProcessEventBodyStartMethod string
const (
	ProcessEventBodyStartMethod_Launch                   ProcessEventBodyStartMethod = "launch"
	ProcessEventBodyStartMethod_Attach                   ProcessEventBodyStartMethod = "attach"
	ProcessEventBodyStartMethod_AttachForSuspendedLaunch ProcessEventBodyStartMethod = "attachForSuspendedLaunch"
)

type ProgressEndEventBody

type ProgressEndEventBody struct {
	Message    *String `json:"message,omitempty"`
	ProgressId string  `json:"progressId"`
}

type ProgressStartEventBody

type ProgressStartEventBody struct {
	Cancellable *Boolean `json:"cancellable,omitempty"`
	Message     *String  `json:"message,omitempty"`
	Percentage  *Number  `json:"percentage,omitempty"`
	ProgressId  string   `json:"progressId"`
	RequestId   *Integer `json:"requestId,omitempty"`
	Title       string   `json:"title"`
}

type ProgressUpdateEventBody

type ProgressUpdateEventBody struct {
	Message    *String `json:"message,omitempty"`
	Percentage *Number `json:"percentage,omitempty"`
	ProgressId string  `json:"progressId"`
}

type ProtocolMessage

type ProtocolMessage struct {
	Seq  int                 `json:"seq"`
	Type ProtocolMessageType `json:"type"`
}

type ProtocolMessageType

type ProtocolMessageType string
const (
	ProtocolMessageType_Request  ProtocolMessageType = "request"
	ProtocolMessageType_Response ProtocolMessageType = "response"
	ProtocolMessageType_Event    ProtocolMessageType = "event"
)

type ReadMemoryArguments

type ReadMemoryArguments struct {
	Count           int      `json:"count"`
	MemoryReference string   `json:"memoryReference"`
	Offset          *Integer `json:"offset,omitempty"`
}

type ReadMemoryResponseBody

type ReadMemoryResponseBody struct {
	Address         string   `json:"address"`
	Data            *String  `json:"data,omitempty"`
	UnreadableBytes *Integer `json:"unreadableBytes,omitempty"`
}

type Request

type Request struct {
	ProtocolMessage
	Command   string           `json:"command"`
	Arguments RequestArguments `json:"arguments,omitempty"`
}

func (*Request) MarshalJSON

func (m *Request) MarshalJSON() ([]byte, error)

MarshalJSON marshalls the request to JSON.

func (*Request) UnmarshalJSON

func (m *Request) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls the request from JSON.

type RequestArguments

type RequestArguments interface {
	// contains filtered or unexported methods
}

type Response

type Response struct {
	ProtocolMessage
	Command    string       `json:"command"`
	Body       ResponseBody `json:"body,omitempty"`
	Message    *String      `json:"message,omitempty"`
	RequestSeq int          `json:"request_seq"`
	Success    bool         `json:"success"`
}

func (*Response) MarshalJSON

func (m *Response) MarshalJSON() ([]byte, error)

MarshalJSON marshalls the response to JSON.

func (*Response) UnmarshalJSON

func (m *Response) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshalls the response from JSON.

type ResponseBody

type ResponseBody interface {
	// contains filtered or unexported methods
}

type RestartArguments

type RestartArguments struct {
	Arguments interface{} `json:"arguments,omitempty"`
}

type RestartFrameArguments

type RestartFrameArguments struct {
	FrameId int `json:"frameId"`
}

type RestartFrameResponseBody

type RestartFrameResponseBody struct{}

type RestartResponseBody

type RestartResponseBody struct{}

type ReverseContinueArguments

type ReverseContinueArguments struct {
	ThreadId int `json:"threadId"`
}

type ReverseContinueResponseBody

type ReverseContinueResponseBody struct{}

type RunInTerminalRequestArguments

type RunInTerminalRequestArguments struct {
	Args  []string               `json:"args"`
	Cwd   string                 `json:"cwd"`
	Env   map[string]interface{} `json:"env,omitempty"`
	Kind  *String                `json:"kind,omitempty"`
	Title *String                `json:"title,omitempty"`
}

type RunInTerminalRequestArgumentsKind

type RunInTerminalRequestArgumentsKind string
const (
	RunInTerminalRequestArgumentsKind_Integrated RunInTerminalRequestArgumentsKind = "integrated"
	RunInTerminalRequestArgumentsKind_External   RunInTerminalRequestArgumentsKind = "external"
)

type RunInTerminalResponseBody

type RunInTerminalResponseBody struct {
	ProcessId      *Integer `json:"processId,omitempty"`
	ShellProcessId *Integer `json:"shellProcessId,omitempty"`
}

type Scope

type Scope struct {
	Column             *Integer `json:"column,omitempty"`
	EndColumn          *Integer `json:"endColumn,omitempty"`
	EndLine            *Integer `json:"endLine,omitempty"`
	Expensive          bool     `json:"expensive"`
	IndexedVariables   *Integer `json:"indexedVariables,omitempty"`
	Line               *Integer `json:"line,omitempty"`
	Name               string   `json:"name"`
	NamedVariables     *Integer `json:"namedVariables,omitempty"`
	PresentationHint   *String  `json:"presentationHint,omitempty"`
	Source             *Source  `json:"source,omitempty"`
	VariablesReference int      `json:"variablesReference"`
}

type ScopesArguments

type ScopesArguments struct {
	FrameId int `json:"frameId"`
}

type ScopesResponseBody

type ScopesResponseBody struct {
	Scopes []*Scope `json:"scopes"`
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a DAP server that accepts connections and starts DAP sessions.

func NewServer

func NewServer(l net.Listener, handler Handler) *Server

NewServer returns a new DAP server that accepts connections and starts DAP sessions.

func (*Server) Accept

func (s *Server) Accept() (*Session, net.Conn, error)

Accept accepts a connection from the listener and returns a new session that reads and writes to the connection.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session handles the low-level mechanics of a DAP session.

func NewSession

func NewSession(r io.Reader, w io.Writer, handler Handler) *Session

NewSession returns a new Session. The session reads messages from the reader and writes messages to the writer. The caller is responsible for closing the reader and writer.

func (*Session) Debug

func (s *Session) Debug(w io.Writer)

Debug sets the debug writer. If the debug writer is non-null, sent and received DAP messages will be written to it.

func (*Session) Event

func (s *Session) Event(event string, body EventBody) error

Event sends a DAP event.

func (*Session) Respond

func (s *Session) Respond(req *Request, success bool, message string, body ResponseBody) error

Respond sends a DAP response to the given request.

func (*Session) Run

func (s *Session) Run() error

Run starts the session. Run blocks until the session is terminated.

type SetBreakpointsArguments

type SetBreakpointsArguments struct {
	Breakpoints    []*SourceBreakpoint `json:"breakpoints,omitempty"`
	Lines          []int               `json:"lines,omitempty"`
	Source         Source              `json:"source"`
	SourceModified *Boolean            `json:"sourceModified,omitempty"`
}

type SetBreakpointsResponseBody

type SetBreakpointsResponseBody struct {
	Breakpoints []*Breakpoint `json:"breakpoints"`
}

type SetDataBreakpointsArguments

type SetDataBreakpointsArguments struct {
	Breakpoints []*DataBreakpoint `json:"breakpoints"`
}

type SetDataBreakpointsResponseBody

type SetDataBreakpointsResponseBody struct {
	Breakpoints []*Breakpoint `json:"breakpoints"`
}

type SetExceptionBreakpointsArguments

type SetExceptionBreakpointsArguments struct {
	ExceptionOptions []*ExceptionOptions       `json:"exceptionOptions,omitempty"`
	FilterOptions    []*ExceptionFilterOptions `json:"filterOptions,omitempty"`
	Filters          []string                  `json:"filters"`
}

type SetExceptionBreakpointsResponseBody

type SetExceptionBreakpointsResponseBody struct{}

type SetExpressionArguments

type SetExpressionArguments struct {
	Expression string       `json:"expression"`
	Format     *ValueFormat `json:"format,omitempty"`
	FrameId    *Integer     `json:"frameId,omitempty"`
	Value      string       `json:"value"`
}

type SetExpressionResponseBody

type SetExpressionResponseBody struct {
	IndexedVariables   *Integer                  `json:"indexedVariables,omitempty"`
	NamedVariables     *Integer                  `json:"namedVariables,omitempty"`
	PresentationHint   *VariablePresentationHint `json:"presentationHint,omitempty"`
	Type               *String                   `json:"type,omitempty"`
	Value              string                    `json:"value"`
	VariablesReference *Integer                  `json:"variablesReference,omitempty"`
}

type SetFunctionBreakpointsArguments

type SetFunctionBreakpointsArguments struct {
	Breakpoints []*FunctionBreakpoint `json:"breakpoints"`
}

type SetFunctionBreakpointsResponseBody

type SetFunctionBreakpointsResponseBody struct {
	Breakpoints []*Breakpoint `json:"breakpoints"`
}

type SetInstructionBreakpointsArguments

type SetInstructionBreakpointsArguments struct {
	Breakpoints []*InstructionBreakpoint `json:"breakpoints"`
}

type SetInstructionBreakpointsResponseBody

type SetInstructionBreakpointsResponseBody struct {
	Breakpoints []*Breakpoint `json:"breakpoints"`
}

type SetVariableArguments

type SetVariableArguments struct {
	Format             *ValueFormat `json:"format,omitempty"`
	Name               string       `json:"name"`
	Value              string       `json:"value"`
	VariablesReference int          `json:"variablesReference"`
}

type SetVariableResponseBody

type SetVariableResponseBody struct {
	IndexedVariables   *Integer `json:"indexedVariables,omitempty"`
	NamedVariables     *Integer `json:"namedVariables,omitempty"`
	Type               *String  `json:"type,omitempty"`
	Value              string   `json:"value"`
	VariablesReference *Integer `json:"variablesReference,omitempty"`
}

type Source

type Source struct {
	AdapterData      interface{} `json:"adapterData,omitempty"`
	Checksums        []*Checksum `json:"checksums,omitempty"`
	Name             *String     `json:"name,omitempty"`
	Origin           *String     `json:"origin,omitempty"`
	Path             *String     `json:"path,omitempty"`
	PresentationHint *String     `json:"presentationHint,omitempty"`
	SourceReference  *Integer    `json:"sourceReference,omitempty"`
	Sources          []*Source   `json:"sources,omitempty"`
}

type SourceArguments

type SourceArguments struct {
	Source          *Source `json:"source,omitempty"`
	SourceReference int     `json:"sourceReference"`
}

type SourceBreakpoint

type SourceBreakpoint struct {
	Column       *Integer `json:"column,omitempty"`
	Condition    *String  `json:"condition,omitempty"`
	HitCondition *String  `json:"hitCondition,omitempty"`
	Line         int      `json:"line"`
	LogMessage   *String  `json:"logMessage,omitempty"`
}

type SourcePresentationHint

type SourcePresentationHint string
const (
	SourcePresentationHint_Normal      SourcePresentationHint = "normal"
	SourcePresentationHint_Emphasize   SourcePresentationHint = "emphasize"
	SourcePresentationHint_Deemphasize SourcePresentationHint = "deemphasize"
)

type SourceResponseBody

type SourceResponseBody struct {
	Content  string  `json:"content"`
	MimeType *String `json:"mimeType,omitempty"`
}

type StackFrame

type StackFrame struct {
	CanRestart                  *Boolean    `json:"canRestart,omitempty"`
	Column                      int         `json:"column"`
	EndColumn                   *Integer    `json:"endColumn,omitempty"`
	EndLine                     *Integer    `json:"endLine,omitempty"`
	Id                          int         `json:"id"`
	InstructionPointerReference *String     `json:"instructionPointerReference,omitempty"`
	Line                        int         `json:"line"`
	ModuleId                    interface{} `json:"moduleId,omitempty"`
	Name                        string      `json:"name"`
	PresentationHint            *String     `json:"presentationHint,omitempty"`
	Source                      *Source     `json:"source,omitempty"`
}

type StackFrameFormat

type StackFrameFormat struct {
	ValueFormat
	IncludeAll      *Boolean `json:"includeAll,omitempty"`
	Line            *Boolean `json:"line,omitempty"`
	Module          *Boolean `json:"module,omitempty"`
	ParameterNames  *Boolean `json:"parameterNames,omitempty"`
	ParameterTypes  *Boolean `json:"parameterTypes,omitempty"`
	ParameterValues *Boolean `json:"parameterValues,omitempty"`
	Parameters      *Boolean `json:"parameters,omitempty"`
}

type StackFramePresentationHint

type StackFramePresentationHint string
const (
	StackFramePresentationHint_Normal StackFramePresentationHint = "normal"
	StackFramePresentationHint_Label  StackFramePresentationHint = "label"
	StackFramePresentationHint_Subtle StackFramePresentationHint = "subtle"
)

type StackTraceArguments

type StackTraceArguments struct {
	Format     *StackFrameFormat `json:"format,omitempty"`
	Levels     *Integer          `json:"levels,omitempty"`
	StartFrame *Integer          `json:"startFrame,omitempty"`
	ThreadId   int               `json:"threadId"`
}

type StackTraceResponseBody

type StackTraceResponseBody struct {
	StackFrames []*StackFrame `json:"stackFrames"`
	TotalFrames *Integer      `json:"totalFrames,omitempty"`
}

type StepBackArguments

type StepBackArguments struct {
	Granularity *String `json:"granularity,omitempty"`
	ThreadId    int     `json:"threadId"`
}

type StepBackResponseBody

type StepBackResponseBody struct{}

type StepInArguments

type StepInArguments struct {
	Granularity *String  `json:"granularity,omitempty"`
	TargetId    *Integer `json:"targetId,omitempty"`
	ThreadId    int      `json:"threadId"`
}

type StepInResponseBody

type StepInResponseBody struct{}

type StepInTarget

type StepInTarget struct {
	Id    int    `json:"id"`
	Label string `json:"label"`
}

type StepInTargetsArguments

type StepInTargetsArguments struct {
	FrameId int `json:"frameId"`
}

type StepInTargetsResponseBody

type StepInTargetsResponseBody struct {
	Targets []*StepInTarget `json:"targets"`
}

type StepOutArguments

type StepOutArguments struct {
	Granularity *String `json:"granularity,omitempty"`
	ThreadId    int     `json:"threadId"`
}

type StepOutResponseBody

type StepOutResponseBody struct{}

type SteppingGranularity

type SteppingGranularity string
const (
	SteppingGranularity_Statement   SteppingGranularity = "statement"
	SteppingGranularity_Line        SteppingGranularity = "line"
	SteppingGranularity_Instruction SteppingGranularity = "instruction"
)

type StoppedEventBody

type StoppedEventBody struct {
	AllThreadsStopped *Boolean `json:"allThreadsStopped,omitempty"`
	Description       *String  `json:"description,omitempty"`
	HitBreakpointIds  []int    `json:"hitBreakpointIds,omitempty"`
	PreserveFocusHint *Boolean `json:"preserveFocusHint,omitempty"`
	Reason            string   `json:"reason"`
	Text              *String  `json:"text,omitempty"`
	ThreadId          *Integer `json:"threadId,omitempty"`
}

type String

type String string

func Str

func Str(v string) *String

Str returns a pointer to v.

func (*String) Eq

func (v *String) Eq(u string) bool

func (*String) Get

func (v *String) Get() string

func (*String) GetOr

func (v *String) GetOr(u string) string

type TerminateArguments

type TerminateArguments struct {
	Restart *Boolean `json:"restart,omitempty"`
}

type TerminateResponseBody

type TerminateResponseBody struct{}

type TerminateThreadsArguments

type TerminateThreadsArguments struct {
	ThreadIds []int `json:"threadIds,omitempty"`
}

type TerminateThreadsResponseBody

type TerminateThreadsResponseBody struct{}

type TerminatedEventBody

type TerminatedEventBody struct {
	Restart interface{} `json:"restart,omitempty"`
}

type Thread

type Thread struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type ThreadEventBody

type ThreadEventBody struct {
	Reason   string `json:"reason"`
	ThreadId int    `json:"threadId"`
}

type ThreadsArguments

type ThreadsArguments struct{}

type ThreadsResponseBody

type ThreadsResponseBody struct {
	Threads []*Thread `json:"threads"`
}

type ValueFormat

type ValueFormat struct {
	Hex *Boolean `json:"hex,omitempty"`
}

type Variable

type Variable struct {
	EvaluateName       *String                   `json:"evaluateName,omitempty"`
	IndexedVariables   *Integer                  `json:"indexedVariables,omitempty"`
	MemoryReference    *String                   `json:"memoryReference,omitempty"`
	Name               string                    `json:"name"`
	NamedVariables     *Integer                  `json:"namedVariables,omitempty"`
	PresentationHint   *VariablePresentationHint `json:"presentationHint,omitempty"`
	Type               *String                   `json:"type,omitempty"`
	Value              string                    `json:"value"`
	VariablesReference int                       `json:"variablesReference"`
}

type VariablePresentationHint

type VariablePresentationHint struct {
	Attributes []string `json:"attributes,omitempty"`
	Kind       *String  `json:"kind,omitempty"`
	Visibility *String  `json:"visibility,omitempty"`
}

type VariablesArguments

type VariablesArguments struct {
	Count              *Integer     `json:"count,omitempty"`
	Filter             *String      `json:"filter,omitempty"`
	Format             *ValueFormat `json:"format,omitempty"`
	Start              *Integer     `json:"start,omitempty"`
	VariablesReference int          `json:"variablesReference"`
}

type VariablesArgumentsFilter

type VariablesArgumentsFilter string
const (
	VariablesArgumentsFilter_Indexed VariablesArgumentsFilter = "indexed"
	VariablesArgumentsFilter_Named   VariablesArgumentsFilter = "named"
)

type VariablesResponseBody

type VariablesResponseBody struct {
	Variables []*Variable `json:"variables"`
}

type WriteMemoryArguments

type WriteMemoryArguments struct {
	AllowPartial    *Boolean `json:"allowPartial,omitempty"`
	Data            string   `json:"data"`
	MemoryReference string   `json:"memoryReference"`
	Offset          *Integer `json:"offset,omitempty"`
}

type WriteMemoryResponseBody

type WriteMemoryResponseBody struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL