Use ptype. If you use it by itself, you get the declared type of the pointer:
(gdb) ptype ptr
type = class SuperClass {
// various members
} *
To get the actual type of the object pointed to, set the “print object” variable:
(gdb) set print object on
(gdb) ptype ptr
type = /* real type = DerivedClass * */
class SuperClass {
// various members
} *