---
title: 생성된 C++ 코드 디버깅
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: outdated
canonical: https://docs.unity.com/ko-kr/engine/6000.0/manual/platform-specific/windows-store/uwp-developing/uwp-il2cpp-scripting/uwp-il2cpp-debugging/uwp-debug-generated-cpp
latest_url: https://docs.unity.com/ko-kr/engine/7000.0/manual/platform-specific/windows-store/uwp-developing/uwp-il2cpp-scripting/uwp-il2cpp-debugging/uwp-debug-generated-cpp.md
last_updated: 2026-10-30
generated_at: 2026-11-03T20:59:21.854Z
locale: ko-kr
---

# 생성된 C++ 코드 디버깅

> **Note:** This page documents version 6000.0. The latest version is 7000.0: https://docs.unity.com/ko-kr/engine/7000.0/manual/platform-specific/windows-store/uwp-developing/uwp-il2cpp-scripting/uwp-il2cpp-debugging/uwp-debug-generated-cpp.md

> Understand how to use Visual Studio to debug your generated C++ code.

Visual Studio를 사용하여 UWP(유니버설 Windows 플랫폼) 애플리케이션용으로 생성된 C++ 코드를 디버깅할 수 있습니다.

## 생성된 C++ 코드의 클래스와 메서드 명명법 이해##understand-class-and-method-naming-in-generated-c++-code

### IL2CPP 클래스##il2cpp-classes

IL2CPP 클래스는 `<ClassName>_t#number` 포맷을 따릅니다.

* `<ClassName>`은 클래스 이름입니다.
* 선택 사항인 `#number`는 고유 유형 번호입니다.

예시 IL2CPP 클래스:

* `String_t` - [String 클래스](https://learn.microsoft.com/en-us/dotnet/api/system.string)
* `Object_t` - [Object 클래스](https://learn.microsoft.com/en-us/dotnet/api/system.object)
* `Type_t` - [Type 클래스](https://learn.microsoft.com/en-us/dotnet/api/system.type)
* `StringBuilder_t26` - [StringBuilder 클래스](https://learn.microsoft.com/en-us/dotnet/api/system.text.stringbuilder)

### IL2CPP 메서드##il2cpp-methods

IL2CPP 메서드는 `<ClassName>_<MethodName>_m#number` 포맷을 따릅니다.

* `<ClassName>`은 메서드의 선언 유형 클래스명입니다.
* `<MethodName>`은 메서드명입니다.
* `#number`는 고유 메서드 번호입니다.

예시 IL2CPP 메서드:

* `ConfigurationSection_DoDeserializeSection_m1275` - [ConfigurationSection 클래스의 DeserializationSection 메서드](https://learn.microsoft.com/en-us/dotnet/api/system.configuration.configurationsection.deserializesection)
* `String_Format_m4102` - [String 클래스의 Format 메서드](https://learn.microsoft.com/en-us/dotnet/api/system.string.format)
* `Mathf_Sqrt_m289` - [Mathf 클래스의 Sqrt 메서드](https://learn.microsoft.com/en-us/dotnet/api/system.mathf.sqrt)

### IL2CPP 정적 필드 구조##il2cpp-static-field-structures

정적 필드 구조는 `<ClassName>_t#number_StaticFields` 포맷을 따르며, 여기서 구조 이름의 첫 번째 부분은 선언 유형과 동일합니다.

예시 정적 필드 구조:

* `StringBuilder_t26_StaticFields`
* `Thing_t24_StaticFields`

### C++ 코멘트##c++-comments

각 클래스나 메서드 정의 앞에 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;
    };
```

## 변수 값 관측##observe-variable-values

[Visual Studio 디버거로](https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/using-visual-studio-tools-for-unity?pivots=windows#unity-debugging) 변수 값을 관찰하여 생성된 C++ 코드를 디버깅할 수 있습니다.

변수를 관찰할 수 있도록 디버거가 중지하게 하려는 [중단점을 Visual Studio에서 설정](/engine/6000.0/manual/scripting/debugging-and-diagnostics/managed-code-debugging.md#BreakpointsVS)할 수 있습니다. Visual Studio를 사용하면 변수 위로 마우스를 올리거나 [Watch 창을 사용](https://learn.microsoft.com/en-us/visualstudio/debugger/watch-and-quickwatch-windows?)하여 변수 값을 관찰할 수 있습니다.

## 정적 필드 관측##observe-a-static-field

IL2CPP에서 Unity는 정적 필드를 Il2CppClass 인스턴스에 저장합니다. 정적 필드의 값을 관찰하려면 다음을 수행해야 합니다.

1. 해당 유형의 Il2CppClass 구조에 대한 [포인터](https://learn.microsoft.com/en-us/cpp/cpp/pointers-cpp)를 코드에서 찾습니다.

   **참고:** 이러한 포인터는 이를 사용하는 메서드의 범위에 있지만, 한 번 관찰한 후에는 애플리케이션 실행 동안 동일한 메모리 주소로 유지됩니다.
2. 해당 포인터에서 `static_fields` 필드의 값을 가져옵니다. 이는 특정 유형의 정적 필드가 포함된 메모리 블록에 대한 포인터입니다.
3. 값을 해당 정적 필드 구조에 캐스트합니다.
4. [Visual Studio 디버거](https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/using-visual-studio-tools-for-unity?pivots=windows#unity-debugging)에서 값을 관찰합니다.

## 예외 분석##investigate-exceptions

IL2CPP는 네이티브 C++ 예외를 사용하여 .NET 예외를 구현합니다.

코드에서 예외를 분석하려면 다음을 수행합니다.

* [Watch 창](https://learn.microsoft.com/en-us/visualstudio/debugger/watch-and-quickwatch-windows?)에서 예외 오브젝트를 검사합니다.
* 디버거가 C++ 예외를 [중단하도록 활성화](https://learn.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger)합니다.

## 추가 리소스##additional-resources

* [Visual Studio를 사용하여 C++ 코드를 디버깅하는 방법에 대한 Microsoft 기술 자료](https://learn.microsoft.com/en-us/visualstudio/debugger/getting-started-with-the-debugger-cpp?)
* [Visual Studio를 사용한 Unity 디버깅에 대한 Microsoft 기술 자료](https://learn.microsoft.com/en-us/visualstudio/gamedev/unity/get-started/using-visual-studio-tools-for-unity?pivots=windows#unity-debugging)
* [IL2CPP 개요](/engine/6000.0/manual/scripting/compilation-and-code-reload/backends/il2cpp.md)
* [UWP용 IL2CPP 스크립팅 백엔드](/engine/6000.0/manual/platform-specific/windows-store/uwp-developing/uwp-il2cpp-scripting.md)
