parlimports

package
v0.4.104 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: ISC Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCreatedLine

func ParseCreatedLine(createdLine string) (funcName string, IsMainThread bool)

ParseCreatedLine parses the second-to-last line of the stack trace. samples:

created by main.main
created by main.(*MyType).goroutine1
main.main()

func ParseFileLine

func ParseFileLine(fileLine string) (file string, line int)

ParseFileLine parses a line of a tab character then absolue file path, followed by a colon and line number, then a space character and a byte offset.

"\t/gp-debug-stack/debug-stack.go:29 +0x44"
"\t/opt/sw/parl/g0/waiterr.go:49"

func ParseFirstLine

func ParseFirstLine(debugStack string) (ID string, status string, err error)

getID obtains gorutine ID, as of go1.18 a numeric string "1"…

func ParseFuncLine

func ParseFuncLine(funcLine string) (funcName string, args string)

ParseFuncLine parses a line of a package name, optionally fully qualified, and a possible receiver type name and a function name, followed by a parenthesised argument list. samples:

main.main()
main.(*MyType).goroutine1(0x0?, 0x140000120d0, 0x2)
codeberg.org/haraldrudell/goprogramming/std/runtime-debug/gp-debug-stack/mypackage.Fn(...)

Types

type Frame

type Frame struct {
	pruntime.CodeLocation
	// contains filtered or unexported fields
}

func (*Frame) Args

func (f *Frame) Args() (args string)

func (*Frame) Loc

func (f *Frame) Loc() (location *pruntime.CodeLocation)

func (*Frame) String

func (f *Frame) String() (s string)

type Stack

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

func NewStack

func NewStack(skipFrames int) (stack *Stack)

NewStack populates a Stack object with the current thread and its stack using debug.Stack

func (*Stack) Creator

func (s *Stack) Creator() (creator *pruntime.CodeLocation)

func (*Stack) Frames

func (s *Stack) Frames() (frames []*Frame)

func (*Stack) ID

func (s *Stack) ID() (threadID string)

func (*Stack) IsMain

func (s *Stack) IsMain() (isMainThread bool)

func (*Stack) SetCreator

func (st *Stack) SetCreator(creator *pruntime.CodeLocation, isMainThread bool)

func (*Stack) SetFrames

func (st *Stack) SetFrames(frames []*Frame)

func (*Stack) SetID

func (st *Stack) SetID(threadID string, status string)

func (*Stack) Shorts

func (st *Stack) Shorts(prepend string) (s string)

func (*Stack) Status

func (s *Stack) Status() (status string)

func (*Stack) String

func (st *Stack) String() (s string)

Jump to

Keyboard shortcuts

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