Early Access Program News

CLion 2021.2 EAP: Improved Natvis Support and FreeRTOS Thread View

The CLion 2021.2 EAP is in full swing. In the last few weeks we’ve already presented CMake Presets support, Lifetime analysis, Cling interpreter integration, various debugger enhancements, and improvements for Docker workflow. This week, we’re giving you a massive update for the LLDB-based debugger on Windows that improves Natvis support, as well as a FreeRTOS thread view!

The new build (212.4321.2) is now available from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). Note that if you are on macOS, there is a separate build for Apple Silicon (M1 chip).

DOWNLOAD CLION 2021.2 EAP

Here are the main highlights:

FreeRTOS thread view

FreeRTOS is a real-time operating system for microcontrollers. If you debug applications with it in CLion, you can now get a view with the task lists. You can switch to the task you are interested in to explore task variables and more.

To get the FreeRTOS thread view, turn it on in Settings/Preferences | Build, Execution, Deployment | Embedded Development | RTOS Integration:

RTOS settings

You also need GDB version 7.4 or higher with Python support. You can use the GDB that is bundled in CLion. This is intended to work for any relevant Run/Debug configuration.

As an example, let’s take this project and the QEMU emulator, create an Embedded GDB Server configuration, and pass the following arguments to the GDB server:

-cpu cortex-m3 -M lm3s811evb -nographic -gdb tcp::1234 -S

RTOS configuration sample

Let’s now launch the debugger and explore the FreeRTOS thread view:
RTOS in action

We plan to add more information to this view, like queues, semaphores, mutexes, and timers (CPP-17219).

If there is anything else you need that’s missing from this view, please let us know!

Improved Natvis support

CLion comes with an LLDB-based debugger for the Microsoft Visual C++ toolchain (MSVC). If you have custom native visualizers in your project, CLion will use them. For a while now we’ve been working on improving Natvis support in CLion and this build brings lots of valuable enhancements.

The following Visual Studio Natvis customization features are now supported:

  • Inheritable attribute, which specifies whether a visualization applies only to a base type, or to a base type and all derived types.
  • Format specifiers, which control the format in which a value is displayed.
  • CustomListItems, allowing you to write custom logic for traversing a data structure.

Built-in renderers:

  • CLion now automatically generates one-line summaries for all structures not covered by Natvis. And summaries are now colored to increase readability.
  • CLion shows the [Raw View] for Natvis-generated values.
  • Built-in formatters are enabled for wide/Unicode strings (wchar_t, char16_t, char32_t).

And other fixes:

  • Enabling the variable sort affects only the top-level and preserves the member order in classes.
  • When you tried copying a selection of variables in our LLDB-based debugger on Windows, some of the data would not be copied. The issue has now been fixed.
  • We’ve implemented a fix for the incorrect rendering of the tuple collection (CPP-21763).

Natvis updates

There is also a pack of improvements for rendering Unreal Engine objects. You can try them in this CLion EAP or in the upcoming Rider for Unreal Engine Preview build, as both tools share the same debugger that our team implements.

And other enhancements

As usual, this build also addresses many functional, UI, and performance glitches and problems.

In Unit Testing support:

  • We’ve addressed the issues causing Boost.Test suites not to be found (CPP-15546).
  • The test tree for Boost.Test is now shown before the actual test execution.
  • Boost.Test integration now supports decorators, such as boost::unit_test::disabled()/enabled().
  • A regression has been fixed that was causing run icons for Catch not to be updated with the test status (CPP-25428).

As you might know, CLion supports CMake, Makefile, Gradle, and compilation database as project models. You can also open a project in CLion without loading a project model. In this case, you can still load the project model later. For this, CLion has the Load CMake Project context action for CMakeLists.txt.

We’ve now added a similar action for Makefile – Load Makefile Project:
Load Makefile project

The typical use case is for Makefile projects that require some preconfigure step or launching some script to prepare the final Makefile, so you might not have it from the very beginning when opening your project in CLion. You can now open such a project simply as a folder, launch the necessary script from the built-in terminal, and then load the Makefile with this context action.

The full release notes are available here.

DOWNLOAD CLION 2021.2 EAP

Your CLion team
JetBrains
The Drive to Develop