From 2307e075c10a30f71756ed48214891fc98b65ea4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 20 Dec 2003 15:53:06 +0000 Subject: [PATCH] cp-demangle.c (d_identifier): In Java mode, skip an optional '$' after the identifier. * cp-demangle.c (d_identifier): In Java mode, skip an optional '$' after the identifier. * testsuite/demangle-expected: Add test case. From-SVN: r74885 --- libiberty/ChangeLog | 6 ++++++ libiberty/cp-demangle.c | 7 +++++++ libiberty/testsuite/demangle-expected | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 695c45059dc1..20d6552a7d37 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2003-12-20 Ian Lance Taylor + + * cp-demangle.c (d_identifier): In Java mode, skip an optional '$' + after the identifier. + * testsuite/demangle-expected: Add test case. + 2003-12-19 Ian Lance Taylor Fix for PR c++/13447: diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 27e09df72881..1e5684c15200 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -1341,6 +1341,13 @@ d_identifier (di, len) name = d_str (di); d_advance (di, len); + /* A Java mangled name may have a trailing '$' if it is a C++ + keyword. This '$' is not included in the length count. We just + ignore the '$'. */ + if ((di->options & DMGL_JAVA) != 0 + && d_peek_char (di) == '$') + d_advance (di, 1); + /* Look for something which looks like a gcc encoding of an anonymous namespace, and replace it with a more user friendly name. */ diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 8bae90eb0a55..dd36b7a24fd1 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -2591,6 +2591,10 @@ Prim.i(int, boolean, byte, double, float, char, java.lang.String, short, long) _ZN4java4util14Map__U24_Entry11class__U24_E java.util.Map$Entry.class$ # +--format=java +_ZN3org7eclipse3cdt5debug8internal4core5model9CVariable6sizeof$Ev +org.eclipse.cdt.debug.internal.core.model.CVariable.sizeof() +# --format=hp _Utf58_0_1__1_2147483647__2147483648 _Utf58_0_1__1_2147483647__2147483648 -- 2.39.5