This seems to be a trivial question, but I could not find an answer to it.
Suppose that I have defined a class Widget and created the overload:
std::ostream& operator<< (std::ostream& o, const Widget &w) {...}
Is there a way to examine a Widget object in gdb by simply printing it using the above overload?
I am using gdb version 7.7.1.
EDIT:
Suppose that w is a Widget object. I am trying this:
call operator<<(std::cout, w)
and getting the following error message from gdb:
(std::ostream &) @0x615120: <incomplete type>