ユニバーサル Windows プラットフォーム (UWP) アプリケーション用に生成された C++ コードは、Visual Studio を使用してデバッグできます。
IL2CPP のクラスは、<ClassName>_t#number
という形式になります。
<ClassName>
はクラス名です。#number
は一意の型番です。IL2CPP クラスの例:
String_t
- String クラス
Object_t
- Object クラス
Type_t
- Type クラス
StringBuilder_t26
- StringBuilder クラス
IL2CPP のメソッドは、<ClassName>_<MethodName>_m#number
という形式になります。
<ClassName>
は、メソッドの、宣言型のクラス名です。<MethodName>
はメソッド名です。#number
は一意のメソッド番号です。IL2CPP のメソッドの例:
ConfigurationSection_DoDeserializeSection_m1275
- ConfigurationSection クラスの DeserializationSection メソッド
String_Format_m4102
- String クラスの Format メソッド
Mathf_Sqrt_m289
- Mathf クラスの Sqrt メソッド
static フィールドの構造体は <ClassName>_t#number_StaticFields
という形式になります。構造体名の最初の部分は宣言型と同じです。
static フィールドの構造体の例:
StringBuilder_t26_StaticFields
Thing_t24_StaticFields
C++ は、それぞれのクラスやメソッドの定義の前に、完全なクラス名あるいはメソッド名を記したコメントを生成します。
C++ のコメントの例:
// System.Text.StringBuilder
struct StringBuilder_t26 : public Object_t
{
// System.Int32 System.Text.StringBuilder::_length
int32_t length_1;
// System.Int32 System.Text.StringBuilder::_maxCapacity
int32_t maxCapacity_2;
};
生成された C++ コードのデバッグは、Visual Studioのデバッガーを使用して 変数の値を監視することで行えます。
デバッガーを中断させたい場所に Visual Studio でブレークポイントを設定する ことで、変数を監視できます。Visual Studio では、変数の上にマウスポインターを移動するか ウォッチウィンドウを使用する ことで、変数の監視が行えます。
IL2CPP では、Unity は static フィールドを Il2CppClass インスタンスに格納します。static フィールドの値を監視するには、以下を行う必要があります。
static_fields
フィールドの値を取得します。これは、その特定の型の static フィールドを含むメモリブロックへのポインターです。IL2CPP は、ネイティブ C++ の例外を使用して .NET の例外を実装します。
コード内の例外の調査は、以下の方法で行えます。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.