6

i would like to ask if there is any way to debug the unreal engine source code with visual Studio Source Code :

(source code).

Everytime i try to set a breakpoint in their source code is just says that it can not reacht this breakpoint.

Community
  • 1
  • 1
Wolff
  • 73
  • 1
  • 2
  • 6
  • Look into attaching a process to visual studio [See Docs](https://msdn.microsoft.com/en-us/library/3s68z0b3.aspx) – Hmax Jul 13 '18 at 14:45

1 Answers1

7

Ensure that you've installed editor symbols for debugging in the installation options for your engine installation.

To do this, from your Epic Games Launcher, open the pulldown beside your current engine version, select options, set "Editor symbols for debugging" to true, and then Apply this change.

I'm not certain whether you'll need to regenerate your project files after doing so.

Once these editor symbols are installed, you should be able to set breakpoints and trace into the engine code.

Kevin Mack
  • 1,174
  • 1
  • 9
  • 20
  • I've noticed that some methods get optimised away regardless of having the symbols downloaded. Is there a way to prevent this? for example: PathFollowingComponent->HasReached will not step into the code or RequestMoveWithImmediateFinish, it just skips over – Jimmyt1988 Oct 28 '18 at 12:20
  • 1
    Yes - if you're developing your game using C++, you can use a DebugGame Editor configuration, which will prevent methods and variables from being optimized out of your game code. The DebugGame Editor configuration compiles your game using a debug configuration, but leaves the engine compiled using a development configuration, so you would still deal with optimization issues if you traced into the engine code. If you need a full debug editor build, with both engine and game compiled in a debug configuration, you'll need to download the engine source and build it yourself. – Kevin Mack Oct 29 '18 at 19:14
  • 1
    @KevinMack I downloaded and compiled the engine from source and used the "Debug Editor" configuration but I can't debug engine code. Any ideas? – Jorge Luque Jun 07 '20 at 23:21
  • For anyone looking for "Editor symbols for debugging" in Unreal Engine 5, in the Epic Games Launcher go to Unreal Engine on left side, Library tab at the top, then click the arrow under Engine Versions section to go to options. – Liron Yahdav Jun 22 '22 at 06:31