pdebug

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: 4 Imported by: 0

Documentation

Overview

Package pdebug provides a portable, parsed stack trace.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStack

func NewStack(skipFrames int) (stack parl.Stack)

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

func ParseFirstLine

func ParseFirstLine(debugStack []byte) (ID parl.ThreadID, status parl.ThreadStatus, err error)

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

Types

type Stack

type Stack struct{ pruntime.Stack }

- Go stack traces are created by runtime.NewStack and is a byte slice

func (*Stack) Creator

func (s *Stack) Creator() (creator *pruntime.CodeLocation, creatorID parl.ThreadID, goRoutineRef string)

the code location of the go statement creating this thread

  • if IsMain is true, zero-value. Check with Creator().IsSet()
  • never nil

func (*Stack) ID

func (s *Stack) ID() (threadID parl.ThreadID)

thread ID 1… for the thread requesting the stack trace

  • ThreadID is comparable and has IsValid and String methods
  • ThreadID is typically an incremented 64-bit integer with main thread having ID 1

func (*Stack) Status

func (s *Stack) Status() (status parl.ThreadStatus)

a word indicating thread status, typically word “running”

Jump to

Keyboard shortcuts

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