Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reduced noise in debug view of stl types

TL;DR: Can the type information displayed in visual studio debugger/intellisense/compiler output for long type names from stl be cleaned up for the developer?

C++, Visual Studio

Consider the code:

std::map<int, int> m;

Consider the type information in

  1. The watch window watch window

  2. With a mouse over on the identifier mouse over

  3. Intellisense prompt (parameters for a method, image formatted for brevity) method parameter

  4. (like #3) intellisense completion for an identifer as you type the name intellisense

Each of these cases is showing type descriptions for stl containers are a long mess of details infrequently needed.

I've noticed visual studio 2011 is now showing string as std::string (an awesome improvement), instead of std::basic_string<char, std::char_traits<char>, std::allocator<char>> - but this doesn't occur for other stl types I've tested.

I know why it is showing that info, I know the info is correct, and critically important in some cases. It is simply my opinion that most of the time, the developer couldn't care less and map<int, int> would be sufficient. Any way to format or configure the output to reduce the noise?

like image 699
payo Avatar asked Apr 29 '12 00:04

payo


1 Answers

The tool you are looking for STLFilt (http://www.bdsoft.com/tools/stlfilt.html).

Courtesy:http://yosefk.com/c++fqa/templates.html#fqa-35.17

Though the cryptic warnings/errors may be cumbersome to decode for a beginner, I would suggest you to get used to it, if you wish to be a pro.

like image 135
Shakir Sharfraz Avatar answered Sep 23 '22 04:09

Shakir Sharfraz