Debugging in .NET in Release mode

前端 未结 3 1304
萌比男神i
萌比男神i 2021-01-12 09:18

Some time ago I\'ve read an article on CLR, where author showed that if a project is compiled in DEBUG mode, before each operator comes a NOP command, thus allowing to debug

3条回答
  •  甜味超标
    2021-01-12 09:56

    Compiling in release mode optimizes the resulting binary, which makes it harder (but not impossible) for the debugger to know which binary code came from which line line of source code.

    Debug mode is designed to make it easier for the debugger to 'follow along', so it separates lines of code with NOP, and does not optimize the resulting binary.

提交回复
热议问题