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


Ruby On Rails Adds Kamal And Thruster Support
17/12/2024

Ruby on Rails 8 has been released. The new version comes preconfigured with Kamal 2 for application deployment, a new proxy called Thruster, and a trio of SQLite database-backed adapters named Solid C [ ... ]



The Art Of Computer Programming - A Great Present
15/12/2024

If you are looking for a programmer present this holiday season, there is one book, or set of books, that should be top of any list... Donald Knuth's The Art of Computer Programming.


More News

espbook

 

Comments




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

Last Updated ( Tuesday, 15 August 2023 )