I use the DDD GUI for GDB, which is specifically designed to display what you might call "complex objects." However, having said that, it is often better for me to code the dbg () method in anything other than trivial classes / structures, and the advantage is that the dbg () method can not only print the contents of the object to stdout, but it can also check the integrity custom objects, including checking that owned / related objects are in expected states, etc., and may obscure information that it knows is valid, but is usually not useful for debugging unless you pass it a "verbose "flag (or have a separate function for details). To simplify the method call from the GDB command line, I wrote methods other than thosewhich take a pointer to the intended dbg () object, as you suggested in your post.
, , , - , std::string, std:: list std:: map ( " " ), - , -, , , . , () , ( ) , / (.. , , "next- > prev" 'this' "prev- > next" 'this' ..), - ( DAG), .... / DAG , . , , .
, , , , .