ScriptBacktrace

package
v0.0.0-...-535787f Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

graphics.gd/classdb/ScriptBacktrace holds an already captured backtrace of a specific script language, such as GDScript or C#, which are captured using graphics.gd/classdb/Engine.CaptureScriptBacktraces.

See graphics.gd/classdb/ProjectSettings "debug/settings/gdscript/always_track_call_stacks" and graphics.gd/classdb/ProjectSettings "debug/settings/gdscript/always_track_local_variables" for ways of controlling the contents of this class.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsScriptBacktrace() Instance
}

type Expanded

type Expanded [1]gdclass.ScriptBacktrace

func (Expanded) Format

func (self Expanded) Format(indent_all int, indent_frames int) string

Converts the backtrace to a string, where the entire string will be indented by 'indent_all' number of spaces, and the individual stack frames will be additionally indented by 'indent_frames' number of spaces.

Note: Calling graphics.gd/classdb/Object.Instance.ToString on a graphics.gd/classdb/ScriptBacktrace will produce the same output as calling Instance.Format with all parameters left at their default values.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsScriptBacktrace

func (self *Extension[T]) AsScriptBacktrace() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.ScriptBacktrace

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsScriptBacktrace

func (self Instance) AsScriptBacktrace() Instance

func (Instance) Format

func (self Instance) Format() string

Converts the backtrace to a string, where the entire string will be indented by 'indent_all' number of spaces, and the individual stack frames will be additionally indented by 'indent_frames' number of spaces.

Note: Calling graphics.gd/classdb/Object.Instance.ToString on a graphics.gd/classdb/ScriptBacktrace will produce the same output as calling Instance.Format with all parameters left at their default values.

func (Instance) GetFrameCount

func (self Instance) GetFrameCount() int

Returns the number of stack frames in the backtrace.

func (Instance) GetFrameFile

func (self Instance) GetFrameFile(index int) string

Returns the file name of the call site represented by the stack frame at the specified index.

func (Instance) GetFrameFunction

func (self Instance) GetFrameFunction(index int) string

Returns the name of the function called at the stack frame at the specified index.

func (Instance) GetFrameLine

func (self Instance) GetFrameLine(index int) int

Returns the line number of the call site represented by the stack frame at the specified index.

func (Instance) GetGlobalVariableCount

func (self Instance) GetGlobalVariableCount() int

Returns the number of global variables (e.g. autoload singletons) in the backtrace.

Note: This will be non-zero only if the include_variables parameter was true when capturing the backtrace with graphics.gd/classdb/Engine.CaptureScriptBacktraces.

func (Instance) GetGlobalVariableName

func (self Instance) GetGlobalVariableName(variable_index int) string

Returns the name of the global variable at the specified index.

func (Instance) GetGlobalVariableValue

func (self Instance) GetGlobalVariableValue(variable_index int) any

Returns the value of the global variable at the specified index.

Warning: With GDScript backtraces, the returned any will be the variable's actual value, including any object references. This means that storing the returned any will prevent any such object from being deallocated, so it's generally recommended not to do so.

func (Instance) GetLanguageName

func (self Instance) GetLanguageName() string

Returns the name of the script language that this backtrace was captured from.

func (Instance) GetLocalVariableCount

func (self Instance) GetLocalVariableCount(frame_index int) int

Returns the number of local variables in the stack frame at the specified index.

Note: This will be non-zero only if the include_variables parameter was true when capturing the backtrace with graphics.gd/classdb/Engine.CaptureScriptBacktraces.

func (Instance) GetLocalVariableName

func (self Instance) GetLocalVariableName(frame_index int, variable_index int) string

Returns the name of the local variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.

func (Instance) GetLocalVariableValue

func (self Instance) GetLocalVariableValue(frame_index int, variable_index int) any

Returns the value of the local variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.

Warning: With GDScript backtraces, the returned any will be the variable's actual value, including any object references. This means that storing the returned any will prevent any such object from being deallocated, so it's generally recommended not to do so.

func (Instance) GetMemberVariableCount

func (self Instance) GetMemberVariableCount(frame_index int) int

Returns the number of member variables in the stack frame at the specified index.

Note: This will be non-zero only if the include_variables parameter was true when capturing the backtrace with graphics.gd/classdb/Engine.CaptureScriptBacktraces.

func (Instance) GetMemberVariableName

func (self Instance) GetMemberVariableName(frame_index int, variable_index int) string

Returns the name of the member variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.

func (Instance) GetMemberVariableValue

func (self Instance) GetMemberVariableValue(frame_index int, variable_index int) any

Returns the value of the member variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.

Warning: With GDScript backtraces, the returned any will be the variable's actual value, including any object references. This means that storing the returned any will prevent any such object from being deallocated, so it's generally recommended not to do so.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsEmpty

func (self Instance) IsEmpty() bool

Returns true if the backtrace has no stack frames.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

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