Thursday, September 23, 2021

How to troubleshoot visual studio debugging

 


When debugging check the followings 

  • Debug can be done in release x64/ release_opt x64/debug x64 configuration does not matter as default configurations are used 

Method 1 Attach to process 

  • Check all dependencies are placed to exe working directory
    • .lib, .dll, PDB
  • Run the exe to be debug
  • Then go to the project to be debugged
  • Toolbar->debug-> attach to process-> select the exe
  • Set debug points in the code run local windows debugger

Method 2 - Set working directory in properties 

 

  • Make sure to put \ at the end of the working directory path 

When debug points are not hit check below 

This section provides information to troubleshoot issues when the debugger isn’t displaying any warnings – the breakpoint is a solid red circle while actively debugging, yet the breakpoint isn’t being hit. 
  • Disable optimization on debugging project and all relevant projects (DLLs, libs, exe) 

 

  • Check your project properties under Linker > Debugging > Generate Program Database File and Generate Debug Info. Be sure these two are set properly. 

 

  • Also, check if C/C++ > General > Debug Information Format is set to Program Database for Edit and Continue (/ZI) or something similar. 

 

  • Check your symbol file exists, ensure you have the right version of your symbol in the right place. 

Reference 

 

No comments:

Post a Comment

LeetCode C++ Cheat Sheet June

🎯 Core Patterns & Representative Questions 1. Arrays & Hashing Two Sum – hash map → O(n) Contains Duplicate , Product of A...