Visual Studio debugger skipping lines

Hi All,

I’ve experienced strange thing with debugging with VS debugger. When I break in

UFloatingPawnMovement::ApplyControlInputToVelocity
and debug step by step (F10) , debugger behaves strangely in lines 137,138. It jumps from line 136 to 138 omitting line 137! Then it moves back from 138 to 137 and continues. Look at the gif attached.

57310-bez-nazwy-1.gif

I compile code under DebugGameEditor configuration. I use engine version downloaded by epic launcher. I did not build engine localy. I’ve already tried to rebuild project both from VS and Editor.

How is this possible ?

thanks in advance.

There are a couple of possible causes that spring to mind

  1. If compiled code is different from source files you will see this behaviour… make sure build is up to date

  2. Visual studio optimizes the compiled source often combining multiple lines of source code into a single execuble line… make sure optimization is turned off at least for debug configurations… 0d flag maybe? Check your c++ project configuration to disable optimization

HTH

Hi,

  1. I know about it. Theoreticaly if source differs from compiled code, I should be unable to attach witch compiler. Anyhow I’ve double checked it and shure that they are the same.
  2. Most likely this is why I am experiencing it. Debugger is likely to behave that way if code was compiled in NON debug configuration. I am not that good in all those things connected with building and build configurations but I understand, that when I hit this compile button I am building only my game module. I am using pre compiled dll’s for everything else. This is why in my code, compiler works alright, but misbehaves in code associated with those precompiled dll’s (they were likely build in NON debug configuration). How to check how those dll’s were compiled? How to compile those engine dll’s localy? Help ;/

thanks for answer :wink:

I came across a similar problem. It turns out that debug symbols in the downloaded version are optimized. If you want to debug engine source code, you need to build the engine source code with Debug-Editor config.