stackdump

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stackdump provides wrappers for runtime.Stack and runtime.Callers with uniform support for skipping caller frames.

⚠ Unlike the functions in the runtime package, these may allocate a non-trivial quantity of memory: use them with care. ⚠

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerPC

func CallerPC(skipDepth int) []uintptr

CallerPC returns a dump of the program counters of the stack starting skipDepth frames before the caller. (CallerPC(0) provides a dump starting at the caller of this function.)

func CallerText

func CallerText(skipDepth int) []byte

CallerText returns a textual dump of the stack starting skipDepth frames before the caller. (CallerText(0) provides a dump starting at the caller of this function.)

Types

type Stack

type Stack struct {
	// Text is a representation of the stack dump in a human-readable format.
	Text []byte

	// PC is a representation of the stack dump using raw program counter values.
	PC []uintptr
}

Stack is a stack dump for a single goroutine.

func Caller

func Caller(skipDepth int) Stack

Caller returns the Stack dump for the calling goroutine, starting skipDepth frames before the caller of Caller. (Caller(0) provides a dump starting at the caller of this function.)

func (Stack) String

func (s Stack) String() string

Jump to

Keyboard shortcuts

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