summaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2000-09-13 22:59:40 +0000
committerHans-Peter Nilsson <hp@axis.com>2000-09-13 22:59:40 +0000
commitadd725cea97081dd1c72467c852b6ee14d864de9 (patch)
tree300e3ec86fd65e6fcf65c8f91b11e21e2ba81720 /libiberty/cplus-dem.c
parent857b601d5aba8fa4773c709dfa498921c95064ef (diff)
downloadgdb-add725cea97081dd1c72467c852b6ee14d864de9.tar.gz
* testsuite/demangle-expected: Add two tests for anonymous
namespaces. * cplus-dem.c (gnu_special): Handle anonymous namespaces.
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index da951331d55..8a672c684b1 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -2812,6 +2812,25 @@ gnu_special (work, mangled, declp)
success = 0;
break;
}
+
+ if (n > 10 && strncmp (*mangled, "_GLOBAL_", 8) == 0
+ && (*mangled)[9] == 'N'
+ && (*mangled)[8] == (*mangled)[10]
+ && strchr (cplus_markers, (*mangled)[8]))
+ {
+ /* A member of the anonymous namespace. There's information
+ about what identifier or filename it was keyed to, but
+ it's just there to make the mangled name unique; we just
+ step over it. */
+ string_append (declp, "{anonymous}");
+ (*mangled) += n;
+
+ /* Now p points to the marker before the N, so we need to
+ update it to the first marker after what we consumed. */
+ p = strpbrk (*mangled, cplus_markers);
+ break;
+ }
+
string_appendn (declp, *mangled, n);
(*mangled) += n;
}