I added a bitset type of virable to watch When debugging but the output infomation is insufficient and not intuitive.
For example,somthing like this:
{
...
std::bitset<26> dictionary;
...
}
F8 start debugging it and add 'dictionary' to watch, the output is:
-dictionary
-<std::_Base_Bitset<1u>>
-M_w=8736 (when changed to binary,it shows: 10001000100000)
-<No data fields>
It can not show the detailed contents of bitset for me to debug it.Then let's look at the result in visual studio 2008 debugger window:
watch1 | | value | [26]{0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0.......} | false | false | true | true | false | ... |
| type | std::bitset<26> | bool | bool | bool | bool | bool | ... |
|
|
It's intuitive and offers enough useful information for developers. Eclipse+cdt and codelite also have the same result with codeblocks. Then i installed wingdb (an application to use mingw/cygwin+gdb in visual studio) and tried visual studio again.This time it shows the same result with codeblocks. Is it gdb's fault?
I selected visual studio 2005/2008 compiler and cdb debugger in codeblocks to debug again,it still can not shows detailed contents.The result is:
dictionary = class std::bitset<26>
---_Array =[1]0x40f227
Now i am confused and not sure what is the culprit. Why codeblocks fails to show the detailed contents of bitset as visual studio does?