aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-10-29 03:10:51 +0000
committerDaniel Jacobowitz <drow@false.org>2002-10-29 03:10:51 +0000
commitfac923e9a2e6a8f791c60eea55313ce75b428000 (patch)
tree69373f8b6b4db3d6c25995501418ea021e42f8cf
parent6ef1bcec6069b5bcb4481998f3dedc5dbcc31921 (diff)
downloadgdb-fac923e9a2e6a8f791c60eea55313ce75b428000.zip
gdb-fac923e9a2e6a8f791c60eea55313ce75b428000.tar.gz
gdb-fac923e9a2e6a8f791c60eea55313ce75b428000.tar.bz2
* c-typeprint.c (c_type_print_base): Print method qualifiers.
-rw-r--r--gdb/ChangeLog.cplus4
-rw-r--r--gdb/c-typeprint.c20
2 files changed, 24 insertions, 0 deletions
diff --git a/gdb/ChangeLog.cplus b/gdb/ChangeLog.cplus
index 07bf6d2..861c8b3 100644
--- a/gdb/ChangeLog.cplus
+++ b/gdb/ChangeLog.cplus
@@ -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
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 1b8d510..a0549a0 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -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");
}
}