diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 17:14:04 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-28 17:14:04 +0200 |
commit | 4c5891186a60c6694f594fed04a411af6c8352d0 (patch) | |
tree | 0f4c267d74ff972993f8227f136ebf25025b32aa | |
parent | 24b36354ffc3aaef93c5add7caa9702160c1c21a (diff) | |
parent | 530e31d4a38a6129c0b7ac7cbd9928788ed28e4b (diff) |
Merge pull request #66525 from Calinou/doc-gdscript-get-stack-debug-instance
Document `print_stack()` and `get_stack()` requiring a debugger connection
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 6cf8c1a30e..a0855b75f4 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -84,7 +84,7 @@ <method name="get_stack"> <return type="Array" /> <description> - 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() @@ -99,6 +99,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. [b]Note:[/b] Not supported for calling from threads. Instead, this will return an empty array. </description> </method> @@ -175,11 +176,12 @@ <method name="print_stack"> <return type="void" /> <description> - Prints a stack trace at the current 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. [b]Note:[/b] Not supported for calling from threads. Instead of the stack trace, this will print the thread ID. </description> </method> |