]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* c-typeprint.c (c_type_print_base): Print method qualifiers.
authorDaniel Jacobowitz <drow@false.org>
Tue, 29 Oct 2002 03:10:51 +0000 (03:10 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 29 Oct 2002 03:10:51 +0000 (03:10 +0000)
gdb/ChangeLog.cplus
gdb/c-typeprint.c

index 07bf6d2359074cc2803549a0a367867f56d29da7..861c8b37c09f54bd89888315923819a93b329e93 100644 (file)
@@ -1,3 +1,7 @@
+2002-10-28  Daniel Jacobowitz  <drow@mvista.com>
+
+       * c-typeprint.c (c_type_print_base): Print method qualifiers.
+
 2002-10-22  David Carlton  <carlton@math.stanford.edu>
 
        * Makefile.in (buildsym.o): Depend on $(gdb_assert_h) and
index 1b8d5106ce496eda336e63049ee846ad78bdbf6a..a0549a05ab7e46703835bffe9f1c622a3d0577ef 100644 (file)
@@ -1000,6 +1000,26 @@ c_type_print_base (struct type *type, struct ui_file *stream, int show,
                                             method_name,
                                             TYPE_FN_FIELD_STATIC_P (f, j),
                                             stream);
+
+                 /* If the method is const or volatile, this will show up as
+                    a qualifier on the first argument.  Handle a missing or
+                    corrupt THIS pointer gracefully, since we shouldn't crash
+                    on corrupt debug information (if we're going to complain
+                    about this it should be in the debug readers, not this
+                    late).  */
+                 if (!TYPE_FN_FIELD_STATIC_P (f, j)
+                     && TYPE_NFIELDS (TYPE_FN_FIELD_TYPE (f, j)) > 0)
+                   {
+                     struct type *method_type, *this_ptr_type, *this_type;
+                     method_type = TYPE_FN_FIELD_TYPE (f, j);
+                     this_ptr_type = TYPE_FIELDS (method_type)[0].type;
+                     if (TYPE_CODE (this_ptr_type) == TYPE_CODE_PTR)
+                       {
+                         this_type = TYPE_TARGET_TYPE (this_ptr_type);
+                         c_type_print_modifier (this_type, stream, 1, 0);
+                       }
+                   }
+
                  fprintf_filtered (stream, ";\n");
                }
            }