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.

vscodeicon

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 .

cmakedebug

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.

 

 

 

vscodeicon

 

More Information

CMake Extension On Visual Studio Marketplace

Related Articles

Microsoft Introduces Unity Extension For VSCode

C# Dev Kit For VS Code Brings Sign In To FOSS 

VSCode Can Do More Than You Imagine

Visual Studio Code Adds Language Detection

Python Extension For Visual Code Updated

CLion Improves C++17 Support

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


JavaZone - The Conference We Missed
25/10/2024

Amongst the many Java related conferences, this one flew under the radar. A real shame because it had many great sessions.
JavaZone might not be that famous internationally, but it still is the bi [ ... ]



Wasmer 5 Adds iOS Support
12/11/2024

The Wasmer team has released Wasmer 5.0. The WebAssembly runtime adds experimental support for more back ends including V8, Wasmi and WAMR. It also now has iOS support, and upgraded compilers includin [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 15 August 2023 )