Printing C++ class objects with GDB

前端 未结 4 1243
不思量自难忘°
不思量自难忘° 2021-01-12 19:54

Is there some \"default function\" to print an object like a string on the GDB when we are debugging C++ applications? Something like: toString();

Or my class have t

4条回答
  •  执念已碎
    2021-01-12 20:56

    gdb has a built-in print command that you can call in gdb on any variable or expression to see its value. You should look at the gdb documentation for details. You can find the full manual here and a decent intro guide can be found here

提交回复
热议问题