I use the same way, and when I need inspect more details of the class object, I will use p PrettyPrint(xxx).c_str()
, in addition if I want a more clear display(do the real line break instead of just print it as “\n”), the gdb command call (size_t)puts(PrettyPrint(xxx).c_str())
will be used.
for the last command, it is better to set the standard output of the process to another terminal.