Debugging with std objects

Answered

Hi,

I'm having trouble when debugging a Visual Studio compiled application.
It's very hard to debug std based variables (such as std::string, std::vector, std::map...)

CLion debugger doesn't allow viewing the content of some of these variables, or the value is hidden in the much deeper level in the debug tree.
See the attached screenshots for a simple string and vector of strings and the debug views as appears in CLion & Visual Studio 2017.

Is there a way to improve or simplify the debugger view for these basic types?

Best Regards,
Alon

 

Code example:

 

Debug using CLion

 

Debug using VS

0
8 comments

Hello!

Please provide a screenshot of `File | Settings | Build, Execution, Deployment | Toolchains` (please capture the screenshot after the compiler detection is completed).

0

Hi,

See attached.

I'm using the visual studio 2017 configuration with CMake options: -G "Visual Studio 15 2017 Win64" -T host=x64 -DCMAKE_BUILD_TYPE=Debug

0

In CLion 2020.3 on Windows with the following MSVC toolchain

and "Visual Studio 15 2017" generator

I got the following:

0

Hi,

I'm not sure if this is related, but I'm using VS 2017 community version + BuildTools (copied to a Professional named folder for a different reason)

I'm still getting the same results as before (using CLion 2020.3)  with the following attached demo:

 

#include <vector>

int main(int argc, char* argv[])
{
std::vector<std::string> exampleVector;
exampleVector.push_back("string1");
exampleVector.push_back("string2");

std::string exampleStr = "this is an example";

return (0);
}

0

That might be the issue. BuildTools doesn't contain native visualizers required to render STL containers.

0

So how can I fix this?

0

You need to have a proper Visual Studio installation (Community or Professional version) which includes native visualizers.

0

Please sign in to leave a comment.