Suppose I've this code:
#include "map"
#include "string"
using namespace std;
int main () {
map<string, string> m = {{"1", "2"}};
return 0;
}
If I set BP at "return 0" and when it's hit, local windows shows:
std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > m <complex data type>
On the other hand, in gdb windows, "p m" can print out "$1 = std::map with 1 element = {["1"] = "2"}". Speedbar can shows the correct value too.
When gdb debugging, can local window in emacs show c++ object's value correct, same as speedbar?
(Speedbar is not convenient because I need manually add/remove data.)
Thanks.
#include <map>
(similar for string) unless you may have a special reason to store them locally in your project's folder. Does your program compile ok?#include <map>
just means that only the system directories are searched for "map".#include "map"
searches more directories than#include <map>
.