inspect

package
v1.5.12 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCallerLine

func GetCallerLine(l *lua.LState, level int) (int, bool)

GetCallerLine returns just the line number of the caller at the given stack level

func GetMemorySize

func GetMemorySize(L *lua.LState) int64

GetMemorySize returns the total estimated memory usage in bytes.

Types

type Local

type Local struct {
	Name  string
	Value lua.LValue
}

Local represents a local variable

type MemoryStats

type MemoryStats struct {
	Tables       int64
	TableEntries int64
	Strings      int64
	StringBytes  int64
	Functions    int64
	UserData     int64
	Threads      int64
	Total        int64
}

MemoryStats holds detailed memory usage statistics.

func GetMemoryStats

func GetMemoryStats(L *lua.LState) MemoryStats

GetMemoryStats walks the Lua state and calculates memory usage.

type StackFrame

type StackFrame struct {
	Level       int
	Source      string
	CurrentLine int
	Name        string
	FuncType    string    // What type of function (Lua, Go, main, etc)
	Locals      []Local   // Local variables
	Upvalues    []Upvalue // Upvalue information
}

StackFrame represents a single frame in the Lua stack

func GetStackFrame

func GetStackFrame(l *lua.LState, level int) (StackFrame, bool)

GetStackFrame captures information about a single stack frame

func (StackFrame) String

func (sf StackFrame) String() string

type StackTrace

type StackTrace struct {
	ThreadID string
	Frames   []StackFrame
}

StackTrace represents a complete stack trace

func GetAllCoroutineStacks

func GetAllCoroutineStacks(l *lua.LState) []*StackTrace

GetAllCoroutineStacks gets stack traces for all coroutines in the registry

func GetStackTrace

func GetStackTrace(l *lua.LState) *StackTrace

GetStackTrace captures a complete stack trace from a Lua state

func (StackTrace) String

func (st StackTrace) String() string

type Upvalue

type Upvalue struct {
	Name  string
	Value lua.LValue
}

Upvalue represents an upvalue

Jump to

Keyboard shortcuts

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