2012-10-15 Luis Machado * value.c (value_actual_type): Check for TYPE_CODE_VOID target types. Index: gdb/gdb/value.c =================================================================== --- gdb.orig/gdb/value.c 2012-10-10 16:54:36.048188274 -0300 +++ gdb/gdb/value.c 2012-10-14 21:41:22.997797277 -0300 @@ -850,8 +850,13 @@ value_actual_type (struct value *value, result = value_type (value); if (opts.objectprint) { - if (TYPE_CODE (result) == TYPE_CODE_PTR + /* If result's target type is TYPE_CODE_VOID, do not try + fetching its rtti type. GDB will try to dereference + the void pointer and will throw an error when trying to + do so. */ + if ((TYPE_CODE (result) == TYPE_CODE_PTR || TYPE_CODE (result) == TYPE_CODE_REF) + && TYPE_CODE (TYPE_TARGET_TYPE (result)) != TYPE_CODE_VOID) { struct type *real_type;