gdebug

package
v0.0.0-...-fcd50c7 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

包gdebug包含程序在运行时进行自我调试的设施。 md5:c0f5e17b30ee5fbc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinVersion

func BinVersion() string

BinVersion 返回当前运行二进制文件的版本。 它使用ghash.BKDRHash和BASE36算法来计算二进制文件的独特版本。 md5:d61ca269b0c85c70

func BinVersionMd5

func BinVersionMd5() string

BinVersionMd5 返回当前运行二进制文件的版本。 它使用MD5算法计算二进制文件的独特版本。 md5:e716b98ad45cf095

func Caller

func Caller(skip ...int) (function string, path string, line int)

Caller 返回调用者函数的名称,以及包含该函数的绝对文件路径和行号。 md5:ede3e19ac5afa26d

func CallerDirectory

func CallerDirectory() string

CallerDirectory 返回调用者的目录。 md5:13a2e4e3afd2554a

func CallerFileLine

func CallerFileLine() string

CallerFileLine 返回调用者的文件路径和行号。 md5:94cba50c9cbd0bd5

func CallerFileLineShort

func CallerFileLineShort() string

CallerFileLineShort 返回调用者所在的文件名和行号。 md5:ca795c06dfcf9d18

func CallerFilePath

func CallerFilePath() string

CallerFilePath 返回调用者的文件路径。 md5:cf0e426c8a45ff1b

func CallerFunction

func CallerFunction() string

CallerFunction 返回调用者函数的名称。 md5:af9ad1617f64a1c2

func CallerPackage

func CallerPackage() string

CallerPackage 返回调用者的包名。 md5:5ce61ae99065c96c

func CallerWithFilter

func CallerWithFilter(filters []string, skip ...int) (function string, path string, line int)

CallerWithFilter 返回调用者函数名、绝对文件路径及其行号。

参数 `filters` 用于过滤调用者的路径。 md5:77e7b623dc180797

func FuncName

func FuncName(f interface{}) string

FuncName 返回给定函数`f`的函数名称。 md5:6ccbd3c81a265a6e

func FuncPath

func FuncPath(f interface{}) string

FuncPath 返回给定函数`f`的完整函数路径。 md5:fcff03839e6125e6

func GoroutineId

func GoroutineId() int

GoroutineId 从堆栈信息中获取并返回当前goroutine的ID。 需要特别注意的是,由于它使用了runtime.Stack函数,因此性能较低。 通常用于调试目的。 md5:c6453659dbcae88d

func PrintStack

func PrintStack(skip ...int)

PrintStack 将运行时堆栈跟踪信息输出到标准错误。 md5:91aa0db11ba5ad2a

func Stack

func Stack(skip ...int) string

Stack 返回调用它的goroutine的格式化堆栈跟踪。它调用runtime.Stack,使用足够大的缓冲区来捕获整个跟踪。 md5:1115a268fe979d5c

func StackWithFilter

func StackWithFilter(filters []string, skip ...int) string

StackWithFilter 返回调用它的goroutine的格式化堆栈跟踪。 它使用足够大的缓冲区调用runtime.Stack以捕获整个跟踪。

参数`filter`用于过滤调用者路径。 md5:5342cfca7c1801ab

func StackWithFilters

func StackWithFilters(filters []string, skip ...int) string

StackWithFilters 返回调用它的goroutine的格式化堆栈跟踪。 它使用足够大的缓冲区调用runtime.Stack以捕获整个跟踪。

参数 `filters` 是一个字符串切片,用于过滤调用者的路径。

待办:使用debug.Stack来提高性能。 md5:febf8524b3fa5e97

Types

This section is empty.

Jump to

Keyboard shortcuts

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