summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_disassembler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript_disassembler.cpp')
-rw-r--r--modules/gdscript/gdscript_disassembler.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_disassembler.cpp b/modules/gdscript/gdscript_disassembler.cpp
index 0acc03be3d..0438bd8903 100644
--- a/modules/gdscript/gdscript_disassembler.cpp
+++ b/modules/gdscript/gdscript_disassembler.cpp
@@ -30,10 +30,10 @@
#ifdef DEBUG_ENABLED
+#include "gdscript.h"
#include "gdscript_function.h"
#include "core/string/string_builder.h"
-#include "gdscript.h"
static String _get_variant_string(const Variant &p_variant) {
String txt;
@@ -312,6 +312,36 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
incr += 3;
} break;
+ case OPCODE_SET_STATIC_VARIABLE: {
+ text += "set_static_variable script(";
+ Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK);
+ text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : "<unknown script>";
+ text += ")";
+ if (gdscript.is_valid()) {
+ text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
+ } else {
+ text += "[<index " + itos(_code_ptr[ip + 3]) + ">]";
+ }
+ text += " = ";
+ text += DADDR(1);
+
+ incr += 4;
+ } break;
+ case OPCODE_GET_STATIC_VARIABLE: {
+ text += "get_static_variable ";
+ text += DADDR(1);
+ text += " = script(";
+ Ref<GDScript> gdscript = get_constant(_code_ptr[ip + 2] & GDScriptFunction::ADDR_MASK);
+ text += gdscript.is_valid() ? gdscript->get_fully_qualified_name().get_file() : "<unknown script>";
+ text += ")";
+ if (gdscript.is_valid()) {
+ text += "[\"" + gdscript->debug_get_static_var_by_index(_code_ptr[ip + 3]) + "\"]";
+ } else {
+ text += "[<index " + itos(_code_ptr[ip + 3]) + ">]";
+ }
+
+ incr += 4;
+ } break;
case OPCODE_ASSIGN: {
text += "assign ";
text += DADDR(1);
@@ -851,7 +881,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
}
text += ")";
- incr = 3 + captures_count;
+ incr = 4 + captures_count;
} break;
case OPCODE_CREATE_SELF_LAMBDA: {
int instr_var_args = _code_ptr[++ip];
@@ -871,7 +901,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
}
text += ")";
- incr = 3 + captures_count;
+ incr = 4 + captures_count;
} break;
case OPCODE_JUMP: {
text += "jump ";
@@ -1130,4 +1160,4 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
}
}
-#endif
+#endif // DEBUG_ENABLED