Documentation
¶
Index ¶
- func CreateProtocolFromXML(xmlString string) (interface{}, error)
- type Client
- func (c *Client) Finish() (*ProtocolResponse, error)
- func (c *Client) GetBreakpointList() ([]ProtocolBreakpoint, error)
- func (c *Client) GetContext(contextID int) ([]ProtocolProperty, error)
- func (c *Client) GetContextNames() ([]ProtocolContext, error)
- func (c *Client) GetProperty(s string) (*ProtocolResponse, error)
- func (c *Client) Init() error
- func (c *Client) Next() (*ProtocolResponse, error)
- func (c *Client) Run() (*ProtocolResponse, error)
- func (c *Client) SetBreakpoint(file string, line int, expr string) error
- func (c *Client) SetBreakpointToCall(funcName string) error
- func (c *Client) SetExceptionBreakpoint() error
- func (c *Client) Step() (*ProtocolResponse, error)
- type Connection
- type ConnectionHandler
- type ProtocolBreakpoint
- type ProtocolContext
- type ProtocolError
- type ProtocolInit
- type ProtocolMessage
- type ProtocolProperty
- type ProtocolResponse
- type ProtocolStack
- type Server
- type Session
- type SessionStateType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProtocolFromXML ¶
CreateProtocolFromXML creator
Types ¶
type Client ¶
type Client struct {
Connection *Connection
Session *Session
}
Client for xdbg srv
func (*Client) Finish ¶
func (c *Client) Finish() (*ProtocolResponse, error)
Finish stops the debugger
func (*Client) GetBreakpointList ¶
func (c *Client) GetBreakpointList() ([]ProtocolBreakpoint, error)
GetBreakpointList returns the current list of activated bp's
func (*Client) GetContext ¶
func (c *Client) GetContext(contextID int) ([]ProtocolProperty, error)
GetContext returns the context by id
func (*Client) GetContextNames ¶
func (c *Client) GetContextNames() ([]ProtocolContext, error)
GetContextNames returns the context name mapping
func (*Client) GetProperty ¶
func (c *Client) GetProperty(s string) (*ProtocolResponse, error)
GetProperty tries fetch a variable by name
func (*Client) Next ¶
func (c *Client) Next() (*ProtocolResponse, error)
Next step over the next instruction
func (*Client) SetBreakpoint ¶
SetBreakpoint creates a breakpoint
func (*Client) SetBreakpointToCall ¶
SetBreakpointToCall creates a call breakpoint
func (*Client) SetExceptionBreakpoint ¶
SetExceptionBreakpoint sets a generic break to exceptions
func (*Client) Step ¶
func (c *Client) Step() (*ProtocolResponse, error)
Step into the next instruction
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection model
func (*Connection) GetResponse ¶
func (c *Connection) GetResponse() (*ProtocolResponse, error)
GetResponse read a message response
func (*Connection) ReadMessage ¶
func (c *Connection) ReadMessage() (interface{}, error)
ReadMessage read a message
func (*Connection) SendMessage ¶
func (c *Connection) SendMessage(msg string)
SendMessage writes a message
type ConnectionHandler ¶
type ConnectionHandler func(*Connection)
ConnectionHandler handles srv accepts
type ProtocolBreakpoint ¶
type ProtocolBreakpoint struct {
ID string `xml:"id,attr"`
Type string `xml:"type,attr"`
FileName string `xml:"filename,attr"`
Line int `xml:"lineno,attr"`
State string `xml:"state,attr"`
HitCount int `xml:"hit_count,attr"`
}
ProtocolBreakpoint data struct
type ProtocolContext ¶
ProtocolContext data struct
type ProtocolError ¶
ProtocolError data struct
type ProtocolInit ¶
type ProtocolInit struct {
FileURI string `xml:"fileuri,attr"`
Language string `xml:"language,attr"`
AppID string `xml:"appid,attr"`
IDEKey string `xml:"idekey,attr"`
}
ProtocolInit data struct
type ProtocolMessage ¶
type ProtocolMessage struct {
Filename string `xml:"filename,attr"`
Line int `xml:"lineno,attr"`
Exception string `xml:"exception,attr"`
Value string `xml:",chardata"`
}
ProtocolMessage data struct
type ProtocolProperty ¶
type ProtocolProperty struct {
Name string `xml:"name,attr"`
Fullname string `xml:"fullname,attr"`
Type string `xml:"type,attr"`
Children int `xml:"children,attr"`
NumChildren int `xml:"numchildren,attr"`
Size int `xml:"size,attr"`
Page int `xml:"page,attr"`
PageSize int `xml:"pagesize,attr"`
Encoding string `xml:"encoding,attr"`
Content string `xml:",chardata"`
Property *[]ProtocolProperty `xml:"property"`
}
ProtocolProperty data struct
type ProtocolResponse ¶
type ProtocolResponse struct {
Command string `xml:"command,attr"`
Context string `xml:"context,attr"`
TransactionID string `xml:"transaction_id,attr"`
Reason string `xml:"reason,attr"`
Status string `xml:"status,attr"`
Error ProtocolError `xml:"error"`
BreakpointList []ProtocolBreakpoint `xml:"breakpoint"`
ContextList []ProtocolContext `xml:"context"`
PropertyList []ProtocolProperty `xml:"property"`
StackList []ProtocolStack `xml:"stack"`
Message ProtocolMessage `xml:"message"`
}
ProtocolResponse data struct
type ProtocolStack ¶
type ProtocolStack struct {
Where string `xml:"where,attr"`
Level int `xml:"level,attr"`
Type string `xml:"type,attr"`
Filename string `xml:"filename,attr"`
Line int `xml:"lineno,attr"`
}
ProtocolStack data struct
type Server ¶
Server model
func (*Server) Accept ¶
func (s *Server) Accept(h ConnectionHandler)
Accept connections and start handler
type Session ¶
type Session struct {
TransactionID int
State SessionStateType
CurrentFile string
CurrentLine int
TargetFiles []string
History []string
}
Session debug session
func (*Session) GetLastCommand ¶
GetLastCommand from history
func (*Session) NextTransactionID ¶
NextTransactionID increments and returns the trans id
func (*Session) SetTargetFiles ¶
SetTargetFiles return all possible execution files
type SessionStateType ¶
type SessionStateType int
SessionStateType enumeration type
const ( // StateStarting initial state StateStarting SessionStateType = iota // StateStopping remote debugger is trying to stop the process StateStopping // StateStopped remote debugger has stopped StateStopped // StateRunning interpreter is running until next breakpoint or EOF StateRunning // StateBreak reached breakpoint StateBreak // StateNone undefined state StateNone )