I'm having trouble creating an std::string
(or any C++ object, I guess) in GDB. I tried lots of variations to the following and none of them seem to work:
(gdb) p std::string("hello")
A syntax error in expression, near `"hello")'.
Is there a way to do it?
(I'm surprised I couldn't find anything about this on the Web. I'm starting to think if my GDB is buggy or I'm doing something very wrong.)