gdb/
[platform/upstream/binutils.git] / gdb / typeprint.c
index cf4158d..c25e705 100644 (file)
@@ -1,7 +1,6 @@
 /* Language independent support for printing types for GDB, the GNU debugger.
 
-   Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
-   2000, 2001, 2003, 2006, 2007, 2008, 2009, 2010, 2011
+   Copyright (C) 1986, 1988-1989, 1991-1995, 1998-2001, 2003, 2006-2012
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -74,7 +73,7 @@ default_print_typedef (struct type *type, struct symbol *new_symbol,
    If SHOW is negative, we never show the details of elements' types.  */
 
 void
-type_print (struct type *type, char *varstring, struct ui_file *stream,
+type_print (struct type *type, const char *varstring, struct ui_file *stream,
            int show)
 {
   LA_PRINT_TYPE (type, varstring, stream, show, 0);
@@ -140,16 +139,7 @@ whatis_exp (char *exp, int show)
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
          && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
-        {
-          real_type = value_rtti_target_type (val, &full, &top, &using_enc);
-          if (real_type)
-            {
-              if (TYPE_CODE (type) == TYPE_CODE_PTR)
-                real_type = lookup_pointer_type (real_type);
-              else
-                real_type = lookup_reference_type (real_type);
-            }
-        }
+        real_type = value_rtti_indirect_type (val, &full, &top, &using_enc);
       else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
        real_type = value_rtti_type (val, &full, &top, &using_enc);
     }
@@ -216,7 +206,7 @@ print_type_scalar (struct type *type, LONGEST val, struct ui_file *stream)
       len = TYPE_NFIELDS (type);
       for (i = 0; i < len; i++)
        {
-         if (TYPE_FIELD_BITPOS (type, i) == val)
+         if (TYPE_FIELD_ENUMVAL (type, i) == val)
            {
              break;
            }