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 ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsScriptBacktrace() Instance
- func (self Instance) Format() string
- func (self Instance) GetFrameCount() int
- func (self Instance) GetFrameFile(index int) string
- func (self Instance) GetFrameFunction(index int) string
- func (self Instance) GetFrameLine(index int) int
- func (self Instance) GetGlobalVariableCount() int
- func (self Instance) GetGlobalVariableName(variable_index int) string
- func (self Instance) GetGlobalVariableValue(variable_index int) any
- func (self Instance) GetLanguageName() string
- func (self Instance) GetLocalVariableCount(frame_index int) int
- func (self Instance) GetLocalVariableName(frame_index int, variable_index int) string
- func (self Instance) GetLocalVariableValue(frame_index int, variable_index int) any
- func (self Instance) GetMemberVariableCount(frame_index int) int
- func (self Instance) GetMemberVariableName(frame_index int, variable_index int) string
- func (self Instance) GetMemberVariableValue(frame_index int, variable_index int) any
- func (self Instance) ID() ID
- func (self Instance) IsEmpty() bool
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
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 Expanded ¶
type Expanded [1]gdclass.ScriptBacktrace
func (Expanded) Format ¶
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 ¶
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]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsScriptBacktrace ¶
type 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.
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 (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsScriptBacktrace ¶
func (Instance) Format ¶
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 ¶
Returns the number of stack frames in the backtrace.
func (Instance) GetFrameFile ¶
Returns the file name of the call site represented by the stack frame at the specified index.
func (Instance) GetFrameFunction ¶
Returns the name of the function called at the stack frame at the specified index.
func (Instance) GetFrameLine ¶
Returns the line number of the call site represented by the stack frame at the specified index.
func (Instance) GetGlobalVariableCount ¶
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 ¶
Returns the name of the global variable at the specified index.
func (Instance) GetGlobalVariableValue ¶
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 ¶
Returns the name of the script language that this backtrace was captured from.
func (Instance) GetLocalVariableCount ¶
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 ¶
Returns the name of the local variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.
func (Instance) GetLocalVariableValue ¶
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 ¶
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 ¶
Returns the name of the member variable at the specified 'variable_index' in the stack frame at the specified 'frame_index'.
func (Instance) GetMemberVariableValue ¶
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.