Early Access Program

CLion 2016.2 EAP: debugger bug fixes and performance enhancements

Hi all,

This week brings a very important CLion 2016.2 EAP (build 162.844.13), as it contains big changes introduced inside CLion’s debugger. We’ve already made a couple of attempts to fix ‘command time out’ and other problems there, but issues still exist and are constantly reported by our users. We’d like to thank you for all the reports and logs you’ve sent. Your collaboration made it finally possible to introduce major changes in GDB and LLDB drivers.

Here’s what to expect from this build.

Debugger

Command timeout

Sometimes an error would occur while collecting frames on breakpoint/interrupt or when the debugger was being launched. The debugging session would hang for some time and then a command timeout was reported to the user. Now a proper error message is reported to the console and in a notification balloon, so the ‘command timeout’ error shouldn’t bother you anymore.

Debugger correctness

We overhauled debugger drivers, making it possible to fix many bugs with stepping and variables views, for example:

  • Value in “Variables” window wasn’t updated after the variable was set (CPP-5933).
  • Debugger failed to show frame variables when stepping into a function if const STL container was in outer frame (CPP-6150).
  • GDB didn’t exit correctly when program waited on cin (CPP-5615).
  • LLDB didn’t stop on breakpoints on case-insensitive file system if there were differences in file names/paths casing (CPP-6598).

GDB and LLDB versions updated

We’ve also updated the bundled LLDB version (OS X only) to 3.8 and the GDB version to 7.11. Along with supported GDB version update, the maximum supported version of MinGW-w64 was updated to 5.3 and Cygwin to 2.5.

Performance improvements

After all changes in both drivers, we ran performance tests to evaluate how they affected debugging startup/shutdown, stepping with various data views and expanding big data structures. The numbers are really promising (the picture shows the correlation between new and old data):

debugger_tests

Besides, there were a few tests which finished with the TIMEOUT previously, while now they take some reasonable time to complete, like for example displaying strings or STL collections.

Other improvements

CMake and Safe delete

Since the very first releases, when you add a new file, CLion has suggested updating the CMake targets with the newly created file. However, this automatic update was not possible in case of file deletion. Now it is!

If you delete a file listed as an argument in certain CMake commands, CLion will search for file usages in CMakeLists.txt files, warn you about an unsafe operation, and update the usages automatically. These CMake commands include:

  • add_executable
  • add_library
  • set
  • add_custom_target_command
  • fltk_wrap_ui
  • qt_wrap_cpp
  • qt_wrap_ui
  • set_property
  • set_source_files_properties, and
  • try_compile

Note that if there are other files listed in the command arguments, CLion will simply delete the reference to the deleted file:
file_safe_delete

However, if the reference to the deleted file is the only command argument, deleting the reference (as well as the command itself) could lead to an incorrect CMake file, so this warning will be shown. You can then view the usages and decide if you’d like to proceed with deleting:
last_file_safe_delete

It works not only for C and C++ files, but for any file type (list resources for example, or other CMake scripts). Directories are not currently supported.

Live templates

We’ve updated Boost-related live templates for CMake files and now there are two – boost and boost_with_libs. The latter is for linking your target with the Boost libraries. You only need to fill the components list and the target name:
boost_libs

Generate definitions

When we first introduced the Generate definition action some users were confused by its behavior. That’s why we’ve collected all the feedback and considered the cases carefully once again. In general, there are several popular behavior templates:

  • declarations are located in header files, definitions are in .cpp files,
  • class/struct is located in a header file only,
  • class/struct is located in a .cpp file only,
  • as well as any other custom case users might be interested in.

CLion now detects the case automatically, providing Generate in-place setting in the generate dialog:

  • It’s always unchecked when the action is called outside a class or a namespace.
  • When called inside a class or a namespace:
    • Unchecked if there are existing functions in the class with outside definitions.
    • Checked if there are no functions in the class or all the functions are in-place.
    • Unchecked if there are no functions in the class, the class is in a header file and there is a corresponding source file (unless it’s a template).

You can use this Generate in-place setting to control the behavior:
generate_definition

Font ligatures

Font ligatures are officially supported by the IntelliJ-based IDEs now, and so does CLion. If you have a font that supports ligatures installed (e.g. FiraCode, Hasklig, Monoid or PragmataPro), then simply go to Preferences/Settings | Editor | Colors & Fonts | Font, choose a corresponding font there and select the Enable font ligatures option. That’s it!
ligatures_font

There are a few more nice changes:

  • IDE’s notifications are now more friendly – there appear in the rightmost bottom corner and are grouped by the subsystem.
  • If you’d like to have a nice background image in your editor, it’s now possible in CLion. Call Find Action (Shift+Ctrl+A on Linux/Windows, ⇧⌘A on OS X), type Set Background Image, select an image and configure its settings in the dialog that appears:
    sea_line_background
  • Git/Mercurial log viewer now loads in the background on every change (a commit, fetch, rebase, etc.) to be always ready when you open it.

As usual, the full release notes are available here.

We encourage you to try the build and let us know about any issues, particularly those affecting the debugger. If you experienced performance problems before, please share if you see any enhancements with the current build.

Your CLion Team
JetBrains
The Drive to Develop

image description

Discover more