Make sure debugging symbols is loaded for libstdc++
. Can be verified using the info sharedlibrary
command.
ptype a
, prints the type of the variable a, in this case it is std::string
If you want to print the underlying structure, try inspecting the type of the object the address of a is pointing to.
ptype &a