|CMake Debugger Added To VS Code|
|Written by Mike James|
|Monday, 14 August 2023|
The new CMake Debugger that was introduced in Visual Studio is now available in VS Code, meaning VS Code developers can debug CMakeLists.txt scripts from VS Code using the CMake Tools Extension.
Visual Studio Code is Microsoft's open source code editor that shares part of a name, but not much else, with full Visual Studio. It is open source under a MIT license and development has been conducted on GitHub.
CMake is an open-source, cross-platform tool that uses compiler and platform independent configuration files to generate native build tool files specific to your compiler and platform.It is wonderful - when it works. When it doesn't it can waste hours trying to figure out what its usually cryptic error messages mean. Add to this the huge number of commands that you can use and the different ways of doing a single task and it makes you wonder why we use it. As I said when it works its wonderful and this is exactly why we use it. So anything that makes it easier to find out what is wrong is really welcome.
The new extension integrates VS Code and CMake so developers can configure, build, and debug projects. The debugger uses the Debug Adapter Protocol, which is compatible with many development environments. What this means is that if you want to use it with something other than VS Code you probably can but you will have to work out how to. The debugger is included with CMake 3.27 and you have to download this latest version to enable the debugger.
Developers using it will see the same functionality as would be available in a normal debugging session, including viewing variables, call stacks, and cache variables specific to CMake and the ability to set breakpoints on your CMakeLists.txt file and step through your code is nothing more than amazing - how can I have struggled with reading and rereading the CMakeLists.txt file to find anything that looked strange. This makes using CMake much more deterministic and less a matter of luck. Of course what you have to do when you have found the bug is still going to be an interesting problem .
Oh wonderous day! Breakpoints and single stepping in Cmake!
The VS Code team says they're now working on other ways to incorporate CMake, including implementing CMake language services and revamping the overall CMake side panel and status bar experiences based on user feedback.
The CMake Extension for VS Code is available on the Visual Studio Marketplace now.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Tuesday, 15 August 2023 )|