debug

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Listener2PeekLen = 9

Variables

This section is empty.

Functions

func Close added in v1.3.7

func Close()

Auto-inserted at defer main for a clean exit. Don't use.

func Exit added in v1.3.1

func Exit(code int)

Auto-inserted in annotated files to replace os.Exit calls. Don't use. Non-annotated files that call os.Exit will not let the editor receive all debug msgs. The sync msgs option will need to be used.

func L added in v1.3.7

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

Auto-inserted at annotations. Don't use. NOTE: func name is used in annotator, don't rename.

func Recover added in v1.3.9

func Recover()

Auto-inserted at functions to recover from panics. Don't use.

func SprintCutCheckQuote added in v1.3.3

func SprintCutCheckQuote(max int, s string) string

Types

type Addr added in v1.3.7

type Addr = net.Addr

type AddrImpl added in v1.3.7

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

a simple addr implementation

func NewAddrI added in v1.3.7

func NewAddrI(network, str string) *AddrImpl

func (*AddrImpl) Network added in v1.3.7

func (addr *AddrImpl) Network() string

func (*AddrImpl) String added in v1.3.7

func (addr *AddrImpl) String() string

type AfdFileIndex added in v1.3.7

type AfdFileIndex = uint16

type AfdFileSize added in v1.3.7

type AfdFileSize = uint32

type AfdMsgIndex added in v1.3.7

type AfdMsgIndex = uint32 // uint16 enough?

type AnnotatorFileData

type AnnotatorFileData struct {
	// decl order matters: used by the config generator to fill the struct
	FileIndex   AfdFileIndex
	NMsgIndexes AfdMsgIndex
	Filename    string
	FileSize    AfdFileSize
	FileHash    []byte
}

type Conn added in v1.3.7

type Conn = net.Conn

type ConnFnCloser added in v1.3.9

type ConnFnCloser struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*ConnFnCloser) Close added in v1.3.9

func (c *ConnFnCloser) Close() error

type Decoder added in v1.3.7

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

type EncDecRegId added in v1.3.9

type EncDecRegId byte

type EncDecRegistry added in v1.3.9

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

encode/decode, id/type, registry

type Encoder added in v1.3.7

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

type FilesDataMsg

type FilesDataMsg struct {
	Data []*AnnotatorFileData
}

type HandshakeMsg added in v1.3.9

type HandshakeMsg struct{ Msg string }

type InitWait added in v1.3.7

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

type Item

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

func IA

func IA(lhs *ItemList, op int, rhs *ItemList) Item

ItemAssign

func IAn

func IAn() Item

ItemAnon

func IB

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

ItemBinary

func IBr

func IBr() Item

ItemBranch

func IC

func IC(enter Item, result Item) Item

ItemCall

func ICe

func ICe(fun Item, args *ItemList) Item

ItemCall: enter

func II

func II(expr, index, result Item) Item

ItemIndex

func II2

func II2(expr, low, high, max Item, slice3 bool, result Item) 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 *ItemList) 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, result Item) Item

ItemSelector

func ISt

func ISt() Item

ItemStep

func ITA

func ITA(x, t, result Item, isSwitch bool) Item

ItemTypeAssert

func IU

func IU(enter Item, result Item) Item

ItemUnary

func IUe

func IUe(op int, x Item) Item

ItemUnary: enter

func IVi added in v1.3.3

func IVi(v any) Item

ItemValue: interface (ex: int=1, string="1")

func IVr added in v1.3.1

func IVr(v int) Item

ItemValue: range

func IVs

func IVs(s string) Item

ItemValue: string (ex: value of "?" is presented without quotes)

func IVt

func IVt(v any) Item

ItemValue: typeof

type ItemAnon

type ItemAnon struct {
	Item
}

type ItemAssign

type ItemAssign struct {
	Item
	Lhs *ItemList
	Op  uint16
	Rhs *ItemList
}

type ItemBinary

type ItemBinary struct {
	Item
	X      Item
	Op     uint16
	Y      Item
	Result Item
}

type ItemBranch

type ItemBranch struct {
	Item
}

type ItemCall

type ItemCall struct {
	Item
	Enter  *ItemCallEnter
	Result Item
}

type ItemCallEnter

type ItemCallEnter struct {
	Item
	Fun  Item
	Args *ItemList
}

type ItemIndex

type ItemIndex struct {
	Item
	Expr   Item
	Index  Item
	Result Item
}

type ItemIndex2

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

type ItemKeyValue

type ItemKeyValue struct {
	Item
	Key   Item
	Value Item
}

type ItemLabel

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

type ItemList

type ItemList struct {
	Item
	List []Item
}

func IL

func IL(u ...Item) *ItemList

ItemList ("," and ";")

type ItemList2

type ItemList2 ItemList // separated by ";"

type ItemLiteral

type ItemLiteral struct {
	Item
	Fields *ItemList
}

type ItemNotAnn added in v1.3.1

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

type ItemParen

type ItemParen struct {
	Item
	X Item
}

type ItemSelector

type ItemSelector struct {
	Item
	X      Item
	Sel    Item
	Result Item
}

type ItemSend

type ItemSend struct {
	Item
	Chan, Value Item
}

type ItemStep

type ItemStep struct {
	Item
}

type ItemTypeAssert

type ItemTypeAssert struct {
	Item
	X        Item
	Type     Item
	Result   Item
	IsSwitch bool
}

type ItemUnary

type ItemUnary struct {
	Item
	Enter  *ItemUnaryEnter
	Result Item
}

type ItemUnaryEnter

type ItemUnaryEnter struct {
	Item
	Op uint16
	X  Item
}

type ItemValue

type ItemValue struct {
	Item
	Str string
}

type Listener added in v1.3.7

type Listener = net.Listener

type Listener2 added in v1.3.9

type Listener2 struct {
	Listener
	// contains filtered or unexported fields
}

besides direct tcp/unix, allows on demand websocket clients

func (*Listener2) Accept added in v1.3.9

func (ln *Listener2) Accept() (Conn, error)

func (*Listener2) Close added in v1.3.9

func (ln *Listener2) Close() error

type Logger added in v1.3.7

type Logger struct {
	Prefix string
	W      io.Writer // ex: os.stderr
}

type MsgWriteBuffering added in v1.3.7

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

func (*MsgWriteBuffering) Write added in v1.3.7

func (wb *MsgWriteBuffering) Write(lm *OffsetMsg) error

type OffsetMsg added in v1.3.7

type OffsetMsg struct {
	FileIndex AfdFileIndex
	MsgIndex  AfdMsgIndex
	Offset    AfdFileSize
	Item      Item
}

type OffsetMsgs added in v1.3.7

type OffsetMsgs []*OffsetMsg

type PeekedConn added in v1.3.9

type PeekedConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*PeekedConn) Read added in v1.3.9

func (c *PeekedConn) Read(b []byte) (int, error)

type PrefixWriter added in v1.3.9

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

func NewPrefixWriter added in v1.3.9

func NewPrefixWriter(writer io.Writer, prefix string) *PrefixWriter

func (*PrefixWriter) Write added in v1.3.9

func (p *PrefixWriter) Write(data []byte) (int, error)

type Proto added in v1.3.7

type Proto interface {
	Read(any) error
	Write(any) error
	WriteMsg(*OffsetMsg) error

	// ex: execside(server/client): close after finished sending
	// ex: editorside(server/client): wait for EOF
	CloseOrWait() error
}

func NewProto added in v1.3.7

func NewProto(ctx context.Context, addr Addr, side ProtoSide, isServer, continueServing bool, logw io.Writer) (Proto, error)

type ProtoClient added in v1.3.9

type ProtoClient struct {
	Logger
	// contains filtered or unexported fields
}

func (*ProtoClient) CloseOrWait added in v1.3.9

func (p *ProtoClient) CloseOrWait() error

func (*ProtoClient) Read added in v1.3.9

func (p *ProtoClient) Read(v any) error

func (*ProtoClient) Write added in v1.3.9

func (p *ProtoClient) Write(v any) error

func (*ProtoClient) WriteMsg added in v1.3.9

func (p *ProtoClient) WriteMsg(m *OffsetMsg) error

type ProtoConn added in v1.3.7

type ProtoConn struct {
	Logger
	// contains filtered or unexported fields
}

func InitProtoSide added in v1.3.9

func InitProtoSide(ctx context.Context, side ProtoSide, conn Conn) (*ProtoConn, error)

func (*ProtoConn) Close added in v1.3.7

func (pconn *ProtoConn) Close() error

func (*ProtoConn) Read added in v1.3.7

func (pconn *ProtoConn) Read(v any) error

func (*ProtoConn) Write added in v1.3.7

func (pconn *ProtoConn) Write(v any) error

func (*ProtoConn) WriteMsg added in v1.3.7

func (pconn *ProtoConn) WriteMsg(m *OffsetMsg) error

type ProtoEditorSide added in v1.3.7

type ProtoEditorSide struct {
	FData *FilesDataMsg // received from exec side

	Logger
	// contains filtered or unexported fields
}

type ProtoExecSide added in v1.3.7

type ProtoExecSide struct {
	FData            *FilesDataMsg // to be sent, can be discarded
	NoWriteBuffering bool

	Logger
	// contains filtered or unexported fields
}

type ProtoServer added in v1.3.9

type ProtoServer struct {
	Logger
	// contains filtered or unexported fields
}

func (*ProtoServer) CloseOrWait added in v1.3.9

func (p *ProtoServer) CloseOrWait() error

func (*ProtoServer) Read added in v1.3.9

func (p *ProtoServer) Read(v any) error

func (*ProtoServer) Write added in v1.3.9

func (p *ProtoServer) Write(v any) error

func (*ProtoServer) WriteMsg added in v1.3.9

func (p *ProtoServer) WriteMsg(m *OffsetMsg) error

type ProtoSide added in v1.3.7

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

type ReqFilesDataMsg

type ReqFilesDataMsg struct{}

type ReqStartMsg

type ReqStartMsg struct{}

Jump to

Keyboard shortcuts

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