I'm currently debugging Unreal Engine 5 (UE5) source code using Visual Studio 2022 and am interested in stepping through the Lightmass code related to precomputed visibility. However, I've encountered an issue where breakpoints set within the Lightmass code are not triggered, displaying the message "No symbols have been loaded for this document." When launching and debugging the Lightmass project independently, breakpoints work as expected.
Upon inspection, I noticed that the Lightmass-related DLLs and PDB files are not loaded during a debugging session of the UE5 project. It appears that Lightmass project, being a separate project, does not automatically start or load its symbols when debugging the UE5 project.
I attempted to start the light build process within the editor and then manually attach the debugger to the process, but this approach did not work. Further investigation revealed that the Lightmass executable launched by VS2022 is located in "Engine\Binaries\Win64", whereas the editor initiates Lightmass from the "Saved\Swarm" directory.
Is there a way to effectively debug Lightmass-related code in this setup?
This is because
UnrealLightmassis an executable that is launched as a separate process from the Swarm Agent. To debug light mass, you will have to follow the same steps that you would to debug any other executable.I will assume that you are using Visual Studio but the steps can be replicated in other IDEs (or debuggers) that support attaching to a process directly:
If you are launching the Editor from Visual Studio:
Debug -> Detach Allin Visual StudioOnce your IDE is not attached to the Editor (but the Editor is still launched):
Debug -> Attach to ProcessUnrealLightmass.exeand clickAttachIf all goes well, you should be able to attach to and debug
LightMassat this point.