2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

UE5のC++ Dynamic Debugging

Posted at

はじめに

Enable C++ Dynamic Debugging in Unreal Engineを試したときの備忘録です。

Riderでも内部的にはMSBuildでビルドするので Dynamic Debuggingのオプション/dynamicdeopt を解釈して、MyActor.gen.cpp.alt.obj等のDynamic Debugging用のシンボルは作成されます。
しかし、デバッグ時にはDynamic Debugging用のシンボルを解釈する機能がないので動きません。
デバッグはVisual Studioが2025/06/13時点だと必要です。

リクエストはされている模様。

環境

  • Windows 11
  • MSVC 14.44.35209
    • フォルダパスはC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207
  • UE 5.7 (ue5-mainのコミットハッシュがb366e59時点のもの)
  • Rider 2025.1.2
  • ビルドターゲット: Development Editor

設定、確認

エンジンをエディタ用にビルドするのでゲームプロジェクトのXxxxEditor.Target.csに下記を追加します。

XxxxEditor.Target.cs
public class XxxxEditorTarget : TargetRules
{
	public XxxxEditorTarget( TargetInfo Target) : base(Target)
	{
        ...

        // Dynamic Debuggingを有効
		WindowsPlatform.bDynamicDebugging = true;
        // ローカルの最新バージョンを利用
		WindowsPlatform.CompilerVersion = "Latest";
        // bDynamicDebugging == trueだと必要とUBTに言われる
		bOverrideBuildEnvironment = true;
	}
}

VCToolChain.csIsDynamicDebuggingEnabledがtrueにならないとDynamic Debugging有効でビルドされないので注意。
有効の場合はVisual Studio Dynamic Debugging is enabledとログが表示されます。

前述のとおり、Dynamic Debuggingの動作はまだVisual Studioのみしかサポートされていないので、Visual Studioで普通にデバッグします。

RiderでDynamic Debugging有効でビルドはできるが、デバッグできない。

試しに下記スクショのようなコードでも変数の値が最適化されて確認できない
という状態になっていないのが確認できます。
このコードに意味はないです。。。
2025-06-13_21h54_03.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?