Getting line number from pdb in release mode

前端 未结 4 1521
走了就别回头了
走了就别回头了 2021-01-18 07:25

Is it possible for the debugger (or the CLR exception handler) to show the line where the exception happened in Release mode using the pdb?

The code, in release mode

4条回答
  •  别那么骄傲
    2021-01-18 08:28

    The debugger makes a best-effort guess at where the problem occurred. It is not guaranteed to be 100% accurate, and with fully optimized code, it often will be inaccurate - I've found the inaccuracies ranging anywhere from a few lines off to having an entirely wrong call stack.

    How accurate the debugger is with optimized code really depends on the code itself and which optimizations you're making.

提交回复
热议问题