pruntimelib

package
v0.4.171 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCreatedLine

func ParseCreatedLine(createdLine []byte) (funcName, goroutineRef 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()”
  • go1.21.5 231219: “created by codeberg.org/haraldrudell/tools/gact.(*Transcriber).TranscriberThread in goroutine 9”
  • no allocations

func ParseFileLine

func ParseFileLine(fileLine []byte) (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 []byte) (ID uint64, status string, err error)

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

func ParseFuncLine

func ParseFuncLine(funcLine []byte) (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(...)

func SplitAbsoluteFunctionName

func SplitAbsoluteFunctionName(absPath string) (
	packagePath, packageName, typePath, funcName string)

SplitAbsoluteFunctionName splits an absolute function name into its parts

  • input: github.com/haraldrudell/parl/error116.(*TypeName).FuncName[...]
  • packagePath: "github.com/haraldrudell/parl/"
  • packageName: "error116" single identifier, not empty
  • typePath: "(*TypeName)" may be empty
  • funcName: "FuncName[...]"

Types

This section is empty.

Jump to

Keyboard shortcuts

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