Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/138.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ gdb不打印数据结构重载方法<&书信电报;_C++_Gdb - Fatal编程技术网

C++ gdb不打印数据结构重载方法<&书信电报;

C++ gdb不打印数据结构重载方法<&书信电报;,c++,gdb,C++,Gdb,我有一个数据结构s,它有一个重载方法“,您可以: call 'operator<< (std::ostream&, myclass&)'(gdbcout, s) 我相信你还会有更多的困难。在任何类s上提供PrintMe()方法可能更容易,然后从GDB调用该方法: print s.PrintMe() call 'operator<< (std::ostream&, myclass&)'(gdbcout, s) std::ostream

我有一个数据结构s,它有一个重载方法“,您可以:

call 'operator<< (std::ostream&, myclass&)'(gdbcout, s)
我相信你还会有更多的困难。在任何类
s
上提供
PrintMe()
方法可能更容易,然后从GDB调用该方法:

print s.PrintMe()
call 'operator<< (std::ostream&, myclass&)'(gdbcout, s)
std::ostream gdbcout (std::cout.rdbuf());
print s.PrintMe()