debug

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptOnlyFirstClient bool // avoid possible hanging progs waiting for another connection to continue debugging (most common case)
View Source
var AnnotatorFilesData []*AnnotatorFileData // all debug data

Vars populated at init by godebugconfig pkg (generated at compile).

View Source
var LimitReachedErr = fmt.Errorf("limit reached")
View Source
var ServerAddress string
View Source
var ServerNetwork string
View Source
var SyncSend bool // don't send in chunks (usefull to get msgs before crash)

Functions

func DecodeMessage

func DecodeMessage(rd io.Reader) (interface{}, error)

func EncodeMessage

func EncodeMessage(msg interface{}) ([]byte, error)

func Exit added in v1.3.1

func Exit(code int)

func ExitServer

func ExitServer()

Auto-inserted at main for a clean exit. Not to be used.

func Line

func Line(fileIndex, debugIndex, offset int, item Item)

Auto-inserted at annotations. Not to be used.

func ReducedSprintf

func ReducedSprintf(max int, format string, a ...interface{}) string

func RegisterStructure

func RegisterStructure(v interface{})

func StartServer

func StartServer()

Called by the generated config.

Types

type AnnotatorFileData

type AnnotatorFileData struct {
	FileIndex int
	DebugLen  int
	Filename  string
	FileSize  int
	FileHash  []byte
}

type CConn

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

Client connection.

func NewCCon

func NewCCon(srv *Server, conn net.Conn) *CConn

func (*CConn) Close

func (cconn *CConn) Close()

func (*CConn) Send

func (cconn *CConn) Send(v *LineMsg)

type Ctx added in v1.1.0

type Ctx struct {
	Parent *Ctx
	// name/value (short names to avoid usage, still exporting it)
	N string
	V interface{}
}

func (*Ctx) Value added in v1.1.0

func (ctx *Ctx) Value(name string) (interface{}, *Ctx)

func (*Ctx) ValueBool added in v1.1.0

func (ctx *Ctx) ValueBool(name string) bool

func (*Ctx) ValueInInterface added in v1.1.0

func (ctx *Ctx) ValueInInterface(depth int) bool

func (*Ctx) ValueIntM1 added in v1.1.0

func (ctx *Ctx) ValueIntM1(name string) int

func (*Ctx) WithInInterface added in v1.1.0

func (ctx *Ctx) WithInInterface(depth int) *Ctx

func (*Ctx) WithValue added in v1.1.0

func (ctx *Ctx) WithValue(name string, value interface{}) *Ctx

type FilesDataMsg

type FilesDataMsg struct {
	Data []*AnnotatorFileData
}

type Item

type Item interface{}

func IA

func IA(lhs, rhs *ItemList) Item

ItemAssign

func IAn

func IAn() Item

ItemAnon

func IB

func IB(result Item, op int, x, y Item) Item

ItemBinary

func IBr

func IBr() Item

ItemBranch

func IC

func IC(name string, result Item, args ...Item) Item

ItemCall

func ICe

func ICe(name string, args ...Item) Item

ItemCall: enter

func II

func II(result, expr, index Item) Item

ItemIndex

func II2

func II2(result, expr, low, high, max Item, slice3 bool) Item

func IKV

func IKV(key, value Item) Item

ItemKeyValue

func IL2

func IL2(u ...Item) Item

func ILa

func ILa(reason string) Item

ItemLabel

func ILit

func ILit(fields ...Item) Item

ItemLiteral

func INAnn added in v1.3.1

func INAnn(reason string) Item

ItemNotAnn

func IP

func IP(x Item) Item

ItemParen

func IS

func IS(ch, value Item) Item

ItemSend

func ISel

func ISel(x, sel Item) Item

ItemSelector

func ISt

func ISt() Item

ItemStep

func ITA

func ITA(x, t Item) Item

ItemTypeAssert

func IU

func IU(result Item, op int, x Item) Item

ItemUnary

func IUe

func IUe(op int, x Item) Item

ItemUnary: enter

func IV

func IV(v V) Item

ItemValue

func IVp added in v1.3.1

func IVp(format string, args ...interface{}) Item

ItemValue: printf usage: newDebugCallExpr("IVp", basicLitStringQ("%v"), basicLitInt(1))

func IVr added in v1.3.1

func IVr(v V) Item

ItemValue: range

func IVs

func IVs(s string) Item

ItemValue: raw string

func IVt

func IVt(v V) Item

ItemValue: typeof

type ItemAnon

type ItemAnon struct{}

type ItemAssign

type ItemAssign struct {
	Lhs, Rhs *ItemList
}

type ItemBinary

type ItemBinary struct {
	Result Item
	Op     int
	X, Y   Item
}

type ItemBranch

type ItemBranch struct{}

type ItemCall

type ItemCall struct {
	Name   string
	Args   *ItemList
	Result Item
}

type ItemCallEnter

type ItemCallEnter struct {
	Name string
	Args *ItemList
}

type ItemIndex

type ItemIndex struct {
	Result Item
	Expr   Item
	Index  Item
}

type ItemIndex2

type ItemIndex2 struct {
	Result         Item
	Expr           Item
	Low, High, Max Item
	Slice3         bool // 2 colons present
}

type ItemKeyValue

type ItemKeyValue struct {
	Key   Item
	Value Item
}

type ItemLabel

type ItemLabel struct{ Reason string } // ex: "for" init not debugged

type ItemList

type ItemList struct {
	List []Item
}

func IL

func IL(u ...Item) *ItemList

ItemList ("," and ";")

type ItemList2

type ItemList2 struct {
	List []Item
}

type ItemLiteral

type ItemLiteral struct{ Fields *ItemList }

type ItemNotAnn added in v1.3.1

type ItemNotAnn struct{ Reason string } // not annotated (ex: String(), Error())

type ItemParen

type ItemParen struct{ X Item }

type ItemSelector

type ItemSelector struct {
	X   Item
	Sel Item
}

type ItemSend

type ItemSend struct {
	Chan, Value Item
}

type ItemStep

type ItemStep struct{}

type ItemTypeAssert

type ItemTypeAssert struct {
	X    Item
	Type Item
}

type ItemUnary

type ItemUnary struct {
	Result Item
	Op     int
	X      Item
}

type ItemUnaryEnter

type ItemUnaryEnter struct {
	Op int
	X  Item
}

type ItemValue

type ItemValue struct{ Str string }

type LimitedWriter

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

func NewLimitedWriter

func NewLimitedWriter(size int) *LimitedWriter

func (*LimitedWriter) Bytes

func (w *LimitedWriter) Bytes() []byte

func (*LimitedWriter) Write

func (w *LimitedWriter) Write(p []byte) (n int, err error)

type LineMsg

type LineMsg struct {
	FileIndex  int
	DebugIndex int
	Offset     int
	Item       Item
}

type Print added in v1.1.0

type Print struct {
	Max int // not a strict max, it helps decide to reduce ouput
	Out []byte
	// contains filtered or unexported fields
}

func NewPrint added in v1.1.0

func NewPrint(max, maxPtrDepth int) *Print

func (*Print) Do added in v1.1.0

func (p *Print) Do(v interface{}) []byte

type ReqFilesDataMsg

type ReqFilesDataMsg struct{}

type ReqStartMsg

type ReqStartMsg struct{}

type Server

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

func NewServer

func NewServer() (*Server, error)

func (*Server) Close

func (srv *Server) Close()

func (*Server) Send

func (srv *Server) Send(v *LineMsg)

type V

type V interface{}

Jump to

Keyboard shortcuts

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