Home > other >  C - in the debugger xcode view IL2CPP string_t content
C - in the debugger xcode view IL2CPP string_t content

Time:09-19

Unity IL2CPP/LLVM back-end generated from c # CPP files. Of course you can read these documents, and put a breakpoint in which to view the variables. However, the c # string converted named String_t custom class. Xcode doesn't seem to know how to print these internal string class, I don't know how to read the raw bytes.
This is String_t definition:

Struct String_t: public Object_t
{
//System. Int32 System. The String: : length
Int32_t ___length;
//System. Char System. The String: : start_char
Uint16_t ___start_char;
};

... Anyone can figure out how to read from the Xcode breakpoint contains the string?

CodePudding user response:

You can use p il2cpp: : utils: : StringUtils: : Utf16ToUtf8. Therefore, if the variable is the name of L_3, then you can do it:

P il2cpp: : utils: : StringUtils: : Utf16ToUtf8 (& amp; L_3 - & gt; ___start_char_1)

CodePudding user response:

Actually if it is not too high requirements, it depends on the string, can be in the watch window, find the string_t variable, right-click the View the Memory of * the variable name
  • Related