I'm investigating the Clang codebase with VS2015, and the .sln
file is generated by CMake.
I've configured the solution to Debug/x64
, and I can see the generated .pdb
files accompanying with the libs, but I can't break on the lib code that linked to the clang executable.
For example, I set some break points in the clangParse module where the control flow must go through during parsing, but after the AST is printed the debugger didn't stop on the break points in the clangParse module, but only on the break points set in the clang module itself.
For some other manually created solutions with executable and static-libs, I can debug those libs. Not sure why this doesn't work for the CMake generated Clang/LLVM solution.
Any special setting I need to make here?
The problem is that the Clang driver internally spawns a child process of itself on Windows and all the interesting things are done in the child process, so the break points in the libs would never hit because they're in another process.
To solve this, install Microsoft Child Process Debugging Power Tool and enable child process debugging, this would attach the child process to the debugger.