From 5e0ef339ffd3dc003016fbf0d55e351fd08946c7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 28 Sep 2022 08:30:53 +0200 Subject: [PATCH] Document `print_stack()` and `get_stack()` requiring a debugger connection (cherry picked from commit 530e31d4a38a6129c0b7ac7cbd9928788ed28e4b) --- modules/gdscript/doc_classes/@GDScript.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 7d23624d2aa..fd382f44258 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -359,7 +359,7 @@ - Returns an array of dictionaries representing the current call stack. + Returns an array of dictionaries representing the current call stack. See also [method print_stack]. [codeblock] func _ready(): foo() @@ -374,6 +374,7 @@ [codeblock] [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] [/codeblock] + [b]Note:[/b] [method get_stack] only works if the running instance is connected to a debugging server (i.e. an editor instance). [method get_stack] will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server. @@ -727,11 +728,12 @@ - Prints a stack track at code location, only works when running with debugger turned on. + Prints a stack trace at the current code location. See also [method get_stack]. Output in the console would look something like this: [codeblock] Frame 0 - res://test.gd:16 in function '_process' [/codeblock] + [b]Note:[/b] [method print_stack] only works if the running instance is connected to a debugging server (i.e. an editor instance). [method print_stack] will not work in projects exported in release mode, or in projects exported in debug mode if not connected to a debugging server.