I've only done this through graphic front ends for gdb. Found this entry in gdb online docs. Hope it helps. I believe this will require that the code was created with debugging info included.
ptype [arg]
ptype accepts the same arguments as whatis, but prints a detailed description of the type, instead of just the name of the type.