2

Is it possible to do something to easily see the contents of a valarray<double> in Clion's debugger?

a06e
  • 18,594
  • 33
  • 93
  • 169

1 Answers1

1

According to JetBrains (1), if using GCC compiler you'll be able to inspect the STL containers during your debug session. In case of Clang it would work for libstdc++ only so you have to set the CMAKE_CXX_FLAGS in CMakeLists.txt to use it:

set(CMAKE_CXX_FLAGS “${CMAKE_CXX_FLAGS} -stdlib=libstdc++”)
mhcuervo
  • 2,610
  • 22
  • 33
  • Note that I can inspect the contents of `vector` without problems. It's `valarray` that gives me trouble. – a06e Jul 01 '15 at 21:49
  • I've never starred at valarray values in debugger but now that you mention it, I gave it a try and got the same result i guess: I can see valarray's size but not the data. Have you tried by disabling all kind of compiler optimizations while Debugging? – mhcuervo Jul 01 '15 at 22:06
  • How can I disable optimizations in CLion? – a06e Jul 02 '15 at 12:29
  • On what platform are you developing? Which compiler are you using? – mhcuervo Jul 02 '15 at 13:20
  • Ubuntu 14.04 64 bits. GCC. – a06e Jul 02 '15 at 14:26