How can i debug with vs2017 after hot reload

I generally find it easier to close the editor and then build run the process from VS. It takes longer but you get better results.

However, if you want to try not restarting the editor then there is a way:

  • Place / Enable your breakpoint
  • Right Click on it and select ‘Conditions’
  • There is a ‘Location’ section at the top of the popup which appears which will end in ‘Must Match Source’. Click on the text
  • Tick the box labelled ‘Allow the source code to be different from the original’

I get mixed results from this. It’s find in some cases, other times it leads to false results but that’s just the nature of it.

Hi,

I have a problem.
When i launch the ue4-editor from vs2017, the debugger works fine. Then i make some changes and build it. The ue4-editor will detect some dlls changed and hot reload them. And then i use vs2017 “debug\attach to process…” menu to debug ue4-editor, the breakpoints can not work. I don’t want to restart the editor. How can i do it?

Thanks.

Yes, if you select “Allow the source code to be different from the original” option, the breakpoints become solid but have no effect.

I checked again, ue4-editor load new dll after hot reload, and keep reference of old dlls. It’s ok, but sometimes vs2017 can not load new dll module(can not find new dll module in module window), so pdb is a wrong version.

Ah, in which case you might be out of luck and need to reload the editor. Before you do that though, it’s worth checking your code and making sure that these breakpoints would actually get hit. It might be worth putting in some breakpoints higher up the callstack and then following it through just to be sure.

Ok, I found the trick, that is because of bug in Visual Studio. That one Visual Studio Feedback

So, in order to debug work you need to execute Hot Reload after visual studio debugger is attached.
One simple way I found - is to compile code, while game is running. Then attach a debugger, then stop a game - hot reload will trigger and breakpoints will work.