Unable to inspect the STL containers during debug

I have a problem inspecting any kind of stl containers.std:string, std:vector , everything I have tried I can't inspect the contents.

Following this https://blog.jetbrains.com/clion/2015/02/clion-eap-news-cmake-3-1-stl-renderers-in-debugger-pty-and-more/  it is supposed that I get a pretty render of a container

which is exactly what I was expecting.

In my case though it seems that I get the raw contents of the vector.Here is what I get

I use MinGw in Windows 10 and cmake.

I am sure that I am missing something fundamental.But I spend the whole day trying to figure out what I am missing.Any ideas?

45 comments
Comment actions Permalink

The same issue happened to me. It worked after I unchecked "Enable GNU C++ library renderers" in Settings.

7
Comment actions Permalink

Hi Bruno.

Is it MinGW, not MinGW-64?

Have you tried using the bundled GDB? I can't reproduce the issue with MinGW and the bundled GDB:

1
Comment actions Permalink

Bruno,

Unfortunately, neither @Ftsakiroglou, nor you have provided accurate version information about toolchain and debugger. And I can't reproduce the issue on my side without this information.

1
Comment actions Permalink

Anna Falevskaya
I will give you a brief description with bundled gdb & Platform Windows 10 x64 

  1. Download Mingw64 from one of these links (preferred ones first ) - https://nuwen.net/mingw.html   or  http://mingw-w64.org/doku.php/download/mingw-builds 
  2. locate gcc binaries -
  3. Setup Toolchain (Clion will be selected for you automatically)
  4. Now run any simple C++ program, here I used std::vector<int> within my gtest module, but you can define any content within a simple main.cpp and observe these results.you can see for SLT container no internal elements are displayed but for primitive types int it will be displayed whatever the value it hold.
  5. When you hover over the std::vector<int> vec this is the result you might inspectrather than displaying the internal elements in the container it's showing the respective container structure at debugging session, we expect to inspect vector's elements which it holds at runtime instead of its stl runtime structure, we expect Clion + GDB works like Visual Studio Debugging
  6. We can do evaluate the expression or the variable and see what's their internals, but that what's not we expecting from IDE at this time considering productivity,it's a hassle right -
  7. Please provide us Visual Studio like easy to debug and inspect mechanism we expect more from CLion at this point. This is the Clion version of mine
1
Comment actions Permalink

I have the official MingW64 version and it behaves the same as Macxfadz wrote.

Please provide assistant

1
Comment actions Permalink

@Winrid, for the Visual Studio C++ toolchain, STL native visualizers are taken from the Visual Studio installation. Do you have the "Enable NatVis renderers for LLDB" option enabled in File | Settings | Build, Execution, Deployment | Debugger | Data Views | C/C++?

I can't reproduce the issue with this option enabled:

1
Comment actions Permalink

As for MinGW

I have the following MinGW-w64 version:

And std::vector looks ok in CLion 2020.1.1:

MinGW-w64 was installed using the MinGW-W64 Online Installer (MinGW-W64-install.exe) downloaded from https://sourceforge.net/projects/mingw-w64/files/

1
Comment actions Permalink

Fuchengshun we have a regression in CLion 2020.3 with MinGW - https://youtrack.jetbrains.com/issue/CPP-23244. Disabling "Enable GNU library renderers" is a workaround.

We are working on the issue right now. Feel free to comment or upvote the issue in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

Sorry for the inconvenience. 

1
Comment actions Permalink

Hello!

Does it work for simple std::vector<int>? Could you please provide a self-contained code sample with which the issue can be reproduced?

0
Comment actions Permalink

Hi Anna.

Yes I get the same with a simple std::vector<int>.

The code for this is just an simple example :

Account* account1 = new Account(0, 13550, "John Tomas");
Account* account2 = new Account(0, 5532, "Elsa Elisson");
Account* account3 = new Account(150, 54583, "George Lassfort");
std::vector<Account> store;
std::vector<int> int_store;
store.push_back(*account1);
store.push_back(*account2);
store.push_back(*account3);
int_store.push_back(3);
int_store.push_back(5);
int_store.push_back(11);

Account class is a simple normal class

class Account
{
private:
double balance;
int id_code;
std::string holder_name;
std::vector<Transaction> log;
public:
Account();

Account(double balance, int idCode, const std::string &holderName);

 

 

0
Comment actions Permalink

Thank you for the details! I can reproduce the issue only with MinGW. In case of MinGW-64 or Cygwin it works fine. Is it possible for you to switch to MinGW-64 or Cygwin?

0
Comment actions Permalink

Seems OK using cygwin. However my compiler is MinGW-64.Are there any clues why this happens for MinGW?

 

 

0
Comment actions Permalink

Please provide the screenshot of File | Settings | Build, Execution, Deployment | Toolchains so that I could see your MinGW-64 version and the GDB version.

0
Comment actions Permalink

I had the same issue. I think there is some regression on 2019. I changed laptop recently and reinstalled everything on windows 10, so I migrated from 2018 to 2019. And now, I can't see vector content anymore on debugging. Problem disapeared when I switched back to 2018.

0
Comment actions Permalink

@Bruno Marcon, what toolchain and OS do you use? What debugger do you use - bundled or other?

0
Comment actions Permalink

Hi Anna. I use MinGW on Windows 10

0
Comment actions Permalink

I did'nt change anything in the setting concerning debugger, so I think it is the bundledGDB. I unisinstalled 2019 so I couldn't reproduce the bug anymore. 

I think it is MinGW64

0
Comment actions Permalink

I saw exactly the same thing as Ftsakiroglou in the post Created April 12, 2019 15:27

 
0
Comment actions Permalink

Hello!

I have exactly the same problem.

I run CLion 2019.2.1 in docker build on Alpine 3.9.2. Thus I cannot use bundled LLDB:

So I use gdb 8.2:

 

The problem is with any STL container, vector, map etc. It does not matter if type is simple int or some complex structure.

I am sure the functionality worked fine before 2019.1.2. But we used CentOS then, so I don't know if problem occurred after our migration to Alpine, or after updating CLion from 2018 to 2019

This is quite urgent for me, make it extremely difficult to debug my software.

 

example:

 

0
Comment actions Permalink

@Wichur,  for bundled GDB do you also get "Does not work in this environment"?

0
Comment actions Permalink

I have the same problem with the following configuration:

0
Comment actions Permalink

@David please send a self-contained code sample, a screenshot illustrating the problem and the debugger log to clion-support at jetbrains.com. To create the log, please enable debugger logging as described here, reproduce the issue and get the resulting idea.log file (`Help | Show Log in ...`). Do not forget to disable debug logging after that. Note that logs might contain private user's information (like file paths and names). 

0
Comment actions Permalink

Macxfadz, you have the same problem as I had. Apparently, it doesn't work, because the MinGW64 distribution at https://nuwen.net/mingw.html does not contain the python support, which is required for the "pretty" debugger to work. You can solve it by installing the official MinGW64 distro from Sourceforge.

0
Comment actions Permalink

David Fido Fiedler I tried officials once too not working same behavior as I explained, I agree with Dror Rejwan

0
Comment actions Permalink

Experiencing this issue with the VisualStudio tool chain as well. Can't debug simple vector<int>.

 

(note that everything here loads, it just refreshes every time I use the win10 Snipping Tool to take a screenshot...)

 

0
Comment actions Permalink

Anna,

The MingW version you are using does not support std threads.

I think CLion should be shipped with a fully working MingW and a decent package manager.

0
Comment actions Permalink

@Dror Rejwan

>I think CLion should be shipped with a fully working MingW and a decent package manager.

There are some concerns to be solved with licensing, distribution sizes, etc, so it's not our immediate priority, unfortunately.

For now I can suggest you either to find GDB which is built with Python support, or to use another toolchain (MSVC with the bundled LLDB, or MinGW 32-bit version with the bundled GDB; not suggesting Cygwin because you already told that it doesn't suit your needs).

 

0
Comment actions Permalink

For everyone who observes this issue with MinGW:

It means that GDB you use is not built with Python support. You need to use a different GDB or pick another MinGW distribution.

Currently we bundle only 32-bit GDB for Windows (built with Python support). Feel free to comment or upvote a feature request about bundling 64-bit GDB for Windows: https://youtrack.jetbrains.com/issue/CPP-16363. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

0
Comment actions Permalink

Tried the distribution you offered previously offered: https://nuwen.net/mingw.html

CLion cannot even use it, does not recognize the environment.

Even after manually configuring make, ,gcc, c++ and gdb, still doesnt work.

 

Will using MSVC with the bundled LLDB allow me full debugging capabilities ?
Because as I understand it, MSVC toolchain debugging is not fully suppoted

0
Comment actions Permalink

@Dror Rejwan

>CLion cannot even use it, does not recognize the environment.

On my side CLion 2020.1.1 is able to detect make and compilers from mingw-17.1.exe (just downloaded it from https://nuwen.net/mingw.html) successfully, but indeed GDB provided in this distribution also doesn't work as expected.

>Will using MSVC with the bundled LLDB allow me full debugging capabilities ? Because as I understand it, MSVC toolchain debugging is not fully suppoted

The LLDB-based debugger developed by JetBrains for the Visual Studio C++ toolchain had been an experimental feature previously, but in CLion 2020.1 we enabled it by default. You can check what issues it has and what features are missing in our tracker: see the "Parent for" section of https://youtrack.jetbrains.com/issue/CPP-14416 and https://youtrack.jetbrains.com/issue/CPP-20370.

0

Please sign in to leave a comment.