aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>2001-02-02 00:27:39 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2001-02-02 00:27:39 +0000
commit3b60dd8e1086b8d477a6fe09c7fe9a07bf410c51 (patch)
tree820789e9640a2091af40cb492ec11fc7d9cd143f /libiberty/cplus-dem.c
parent4bae4eb55f43063018e5299274f7da5a0c057247 (diff)
downloadgcc-3b60dd8e1086b8d477a6fe09c7fe9a07bf410c51.zip
gcc-3b60dd8e1086b8d477a6fe09c7fe9a07bf410c51.tar.gz
gcc-3b60dd8e1086b8d477a6fe09c7fe9a07bf410c51.tar.bz2
Add support for Java demangling under the v3 ABI:
* cp-demangle.c (NAMESPACE_SEPARATOR): New define. (struct demangling_def): Add `style' field. (demangling_new): New parameter `style'. Set it in demangling_t. (demangle_prefix): Use NAMESPACE_SEPARATOR. (demangle_type_ptr): Don't emit pointer symbol if doing Java output. (cp_demangle): New parameter `style'. Pass it to demangling_new(). (main): Call cp_demangle with extra parameter. (java_demangle_v3): New function. (java_builtin_type_names): New. Table of primitive type names used for Java demangling. (demangle_builtin_type): Look up in java_builtin_type_names if doing Java output. * cplus-dem.c (cplus_demangle): Use java_demangle_v3 to do Java demangling. (long_options): Remove obsolete `java' option. (main): Remove explicit handling of `java' option. Instead, pass style parameter in cplus_demangle flags as gdb does. * testsuite/demangle.expected: Add some Java test cases. From-SVN: r39399
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index a42f45e..d49ec7c 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -1,6 +1,6 @@
/* Demangler for GNU C++
Copyright 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000 Free Software Foundation, Inc.
+ 2000, 2001 Free Software Foundation, Inc.
Written by James Clark (jjc@jclark.uucp)
Rewritten by Fred Fish (fnf@cygnus.com) for ARM and Lucid demangling
Modified by Satish Pai (pai@apollo.hp.com) for HP demangling
@@ -922,6 +922,13 @@ cplus_demangle (mangled, options)
return ret;
}
+ if (JAVA_DEMANGLING)
+ {
+ ret = java_demangle_v3 (mangled);
+ if (ret)
+ return ret;
+ }
+
if (GNAT_DEMANGLING)
return ada_demangle(mangled,options);
@@ -4950,7 +4957,6 @@ static struct option long_options[] = {
{"strip-underscores", no_argument, 0, '_'},
{"format", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
- {"java", no_argument, 0, 'j'},
{"no-strip-underscores", no_argument, 0, 'n'},
{"version", no_argument, 0, 'v'},
{0, no_argument, 0, 0}
@@ -5044,12 +5050,13 @@ main (argc, argv)
char *result;
int c;
const char *valid_symbols;
+ enum demangling_styles style;
program_name = argv[0];
strip_underscore = prepends_underscore;
- while ((c = getopt_long (argc, argv, "_ns:j", long_options, (int *) 0)) != EOF)
+ while ((c = getopt_long (argc, argv, "_ns:", long_options, (int *) 0)) != EOF)
{
switch (c)
{
@@ -5067,13 +5074,8 @@ main (argc, argv)
case '_':
strip_underscore = 1;
break;
- case 'j':
- flags |= DMGL_JAVA;
- break;
case 's':
{
- enum demangling_styles style;
-
style = cplus_demangle_name_to_style (optarg);
if (style == unknown_demangling)
{
@@ -5146,7 +5148,7 @@ main (argc, argv)
skip_first = i;
mbuffer[i] = 0;
-
+ flags |= style;
result = cplus_demangle (mbuffer + skip_first, flags);
if (result)
{