| 44 | #include "core/string/string_builder.h" |
| 45 | |
| 46 | static String _get_variant_string(const Variant &p_variant) { |
| 47 | String txt; |
| 48 | if (p_variant.get_type() == Variant::STRING) { |
| 49 | txt = "\"" + String(p_variant) + "\""; |
| 50 | } else if (p_variant.get_type() == Variant::STRING_NAME) { |
| 51 | txt = "&\"" + String(p_variant) + "\""; |
| 52 | } else if (p_variant.get_type() == Variant::NODE_PATH) { |
| 53 | txt = "^\"" + String(p_variant) + "\""; |
| 54 | } else if (p_variant.get_type() == Variant::OBJECT) { |
| 55 | Object *obj = p_variant; |
| 56 | if (!obj) { |
| 57 | txt = "null"; |
| 58 | } else { |
| 59 | GDScriptNativeClass *cls = Object::cast_to<GDScriptNativeClass>(obj); |
| 60 | if (cls) { |
| 61 | txt = "class(" + cls->get_name() + ")"; |
| 62 | } else { |
| 63 | Script *script = Object::cast_to<Script>(obj); |
| 64 | if (script) { |
| 65 | txt = "script(" + GDScript::debug_get_script_name(script) + ")"; |
| 66 | } else { |
| 67 | txt = "object(" + obj->get_class(); |
| 68 | if (obj->get_script_instance()) { |
| 69 | txt += ", " + GDScript::debug_get_script_name(obj->get_script_instance()->get_script()); |
| 70 | } |
| 71 | txt += ")"; |
| 72 | } |
| 73 | } |
| 74 | } |
| 75 | } else { |
| 76 | txt = p_variant; |
| 77 | } |
| 78 | return txt; |
| 79 | } |
| 80 | |
| 81 | static String _disassemble_address(const GDScript *p_script, const GDScriptFunction &p_function, int p_address) { |
| 82 | int addr = p_address & GDScriptFunction::ADDR_MASK; |
no test coverage detected