CLion STL containers not displaying correctly in debugger on Fedora 23
Asked Answered
D

2

9

When I use the GDB of CLion for debugging on vectors for example, no value is printed at all, even if the vector is in fact filled. I have activated the GNU C++ view, which effectively hides the M inner variables, but it still doesn't show anything. I tried searching on google but I can't find any info about it, as it is written everywhere this is provided out of the box.

I am on Fedora 23, I am using g++ 5.3.1, I am on CLion 2016.2 with the bundled CMake and GDB.

Thanks in advance.

Demeanor answered 26/7, 2016 at 10:2 Comment(2)
Do you have some push_back calls in the code you are debugging? This looks related to youtrack.jetbrains.com/issue/CPP-7166 and youtrack.jetbrains.com/issue/CPP-7032Taradiddle
intellij-support.jetbrains.com/hc/en-us/community/posts/…Springlet
K
7

Go here and UNCHECK this checkbox. It helped to me.

Settings -> Build, Execution, Delpoyment -> Debugger -> Data Views -> C/C++ -> "Enable GNU C++ library renders" (screenshot)

then restart debug session

Kymric answered 13/1, 2021 at 13:35 Comment(0)
B
1

Here are my example codes:

#include <iostream>
#include <vector>
int main() {
    auto *v = new std::vector<int>();
    v->push_back(1);
    v->push_back(2);
    v->push_back(3);
    v->push_back(4);
    return 0;
}

set a breakpoint as usual, click on this thing.

click on this thing

then write *v in the Code Fragment, you can see values in vectors.

you can see values in vectors

Broyles answered 9/5, 2019 at 9:43 Comment(1)

© 2022 - 2024 — McMap. All rights reserved.