aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2003-12-16 00:58:45 +0000
committerDJ Delorie <dj@redhat.com>2003-12-16 00:58:45 +0000
commitd35d0cd43c20f6f014da29ddf38f345aac490a2b (patch)
treee53c96363b9a23a3c03cf6c1885cff75db841b70
parentab4f2b471a55bf908cba5f5623a99466f55ff523 (diff)
downloadgdb-d35d0cd43c20f6f014da29ddf38f345aac490a2b.zip
gdb-d35d0cd43c20f6f014da29ddf38f345aac490a2b.tar.gz
gdb-d35d0cd43c20f6f014da29ddf38f345aac490a2b.tar.bz2
merge from gcc
-rw-r--r--libiberty/ChangeLog11
-rw-r--r--libiberty/cp-demangle.c73
-rw-r--r--libiberty/testsuite/demangle-expected5
3 files changed, 57 insertions, 32 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index cd7200d..0a027a0 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,14 @@
+2003-12-15 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_print_function_type): Print the function
+ parameters with no modifiers.
+ * testsuite/demangle-expected: Add test case.
+
+ * cp-demangle.c (d_demangle): If DMGL_PARAMS is not set, don't
+ expect that we've read the entire string.
+ (is_ctor_or_dtor): Don't expect that we've read the entire
+ string--reverse patch of 2003-11-29.
+
2003-12-15 Brendan Kehoe <brendan@zen.org>
* libiberty/Makefile.in (floatformat.o): Add dependency on
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index e675752..f6c0543 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3396,7 +3396,14 @@ d_print_function_type (dpi, dc, mods)
d_append_char (dpi, '(');
if (d_right (dc) != NULL)
- d_print_comp (dpi, d_right (dc));
+ {
+ struct d_print_mod *hold_modifiers;
+
+ hold_modifiers = dpi->modifiers;
+ dpi->modifiers = NULL;
+ d_print_comp (dpi, d_right (dc));
+ dpi->modifiers = hold_modifiers;
+ }
d_append_char (dpi, ')');
@@ -3622,9 +3629,11 @@ d_demangle (mangled, options, palc)
else
dc = d_type (&di);
- /* If we didn't consume the entire mangled string, then we didn't
- successfully demangle it. */
- if (d_peek_char (&di) != '\0')
+ /* If DMGL_PARAMS is set, then if we didn't consume the entire
+ mangled string, then we didn't successfully demangle it. If
+ DMGL_PARAMS is not set, we didn't look at the trailing
+ parameters. */
+ if (((options & DMGL_PARAMS) != 0) && d_peek_char (&di) != '\0')
dc = NULL;
#ifdef CP_DEMANGLE_DEBUG
@@ -3829,37 +3838,37 @@ is_ctor_or_dtor (mangled, ctor_kind, dtor_kind)
dc = d_mangled_name (&di, 1);
+ /* Note that because we did not pass DMGL_PARAMS, we don't expect to
+ demangle the entire string. */
+
ret = 0;
- if (d_peek_char (&di) == '\0')
+ while (dc != NULL)
{
- while (dc != NULL)
+ switch (dc->type)
{
- switch (dc->type)
- {
- default:
- dc = NULL;
- break;
- case D_COMP_TYPED_NAME:
- case D_COMP_TEMPLATE:
- case D_COMP_RESTRICT_THIS:
- case D_COMP_VOLATILE_THIS:
- case D_COMP_CONST_THIS:
- dc = d_left (dc);
- break;
- case D_COMP_QUAL_NAME:
- dc = d_right (dc);
- break;
- case D_COMP_CTOR:
- *ctor_kind = dc->u.s_ctor.kind;
- ret = 1;
- dc = NULL;
- break;
- case D_COMP_DTOR:
- *dtor_kind = dc->u.s_dtor.kind;
- ret = 1;
- dc = NULL;
- break;
- }
+ default:
+ dc = NULL;
+ break;
+ case D_COMP_TYPED_NAME:
+ case D_COMP_TEMPLATE:
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ dc = d_left (dc);
+ break;
+ case D_COMP_QUAL_NAME:
+ dc = d_right (dc);
+ break;
+ case D_COMP_CTOR:
+ *ctor_kind = dc->u.s_ctor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
+ case D_COMP_DTOR:
+ *dtor_kind = dc->u.s_dtor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
}
}
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index b39e2f4..7452338 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -2916,6 +2916,11 @@ void f<-1>()
_ZNSdD0Ev
std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()
#
+# Another case where we got member function qualifiers wrong.
+--format=gnu-v3
+_ZNK15nsBaseHashtableI15nsUint32HashKey8nsCOMPtrI4IFooEPS2_E13EnumerateReadEPF15PLDHashOperatorRKjS4_PvES9_
+nsBaseHashtable<nsUint32HashKey, nsCOMPtr<IFoo>, IFoo*>::EnumerateRead(PLDHashOperator (*)(unsigned int const&, IFoo*, void*), void*) const
+#
# This caused an infinite loop.
#
# This is generated by an EDG compiler (kcc 4.0). To demangle it