Debugging CERN ROOT scripts and ROOT-based programs in Eclipse IDE

ROOT is written in C++, a language with complete manual control over the memory. Therefore, execution of your your ROOT script may sometimes lead to a crash providing minimal information in the stack trace. ROOT does not provide any out-of-the-box solutions for debugging ROOT scripts. Hence, a question about debugging ROOT scripts now and then arises in the ROOT community.


This is a companion discussion topic for the original entry at https://root.cern/blog/debuging-root-scripts-in-eclipse/
1 Like

As the author of cmake4eclipse, I am glad to see my plugin is mentioned by CERN.

Just some thoughts on your setup of cmake4eclipse:

  • You recommend to set the C++ standard used for the build for the tool (cmake) as a commen line argument. IMHO, it would be better to specify it inside the CMakelists.txt files since the authors of the source code know best which C++ standard is required to compile. See [C_STANDARD_REQUIRED]in cmake’s help. Note that CMake even allows to specify the standard on a per-target level; allowing you to mix standards.
  • You state Cmake4eclipse plugin performs a so-called in-source build. This is not really the case, it does not put object files and generated scripts along with the source files (although it places these below the project root). But excluding the _build folder from indexing is a good idea, anyway.
  • Your Tip: if having problems with the build later, check “Force re-creation with each build”. This will trigger the CMakeLists.txt update and re-generation of the Unix makefile at every build, reflecting possible changes in the CMake cache entries (variables) and ROOT components’ source code. should not be necessary: As of cmake4eclipse 3.0.5, changes in the CMake cache entries as well as changes in one of the CMakeLists.txt should automatically re-trigger makefile generation. If not, file a bug.
1 Like