Reputation: 39
I have compiled a very simple file with the command
clang++ main.cpp -g -o test
then
lldb ./test
b main , r, gui, n n n n n …
and as you can see in the upper part of the following screenshot, the variable named “unordered” which is an unordered set, has a size of zero, though it doesn't …
the code prints out “1” for unordered.size()
in GDB there is no problem with the same binary, can someone point me in the right direction?
I don't know how to do this in cmd lldb but through vscodium debugging panel the variable inspector allows me to see the “raw” content of “unordered” which has something like “m_element_count” so there is the information…
here the source file in plain text.
int main() {
char c;
std::unordered_set<char*> unordered;
unordered.insert(&c);
std::set<char*> ordered;
ordered.insert(&c);
std::cout <<unordered.size() << " " << ordered.size() << std::endl;
}
.
(gdb) info locals
c = 46 ‘.’
unordered = std::unordered_set with 1 element = {[0] = 0x7fffffffde67 “.@\343VUUU”}
ordered = std::set with 1 element = {[0] = 0x7fffffffde67 “.@\343VUUU”}
thank you in advance
Upvotes: 0
Views: 18