* external.h (GET_LINENO_LNNO): Use H_GET_32/16.
[deliverable/binutils-gdb.git] / libiberty / cplus-dem.c
index a42f45e6426b1727a439d71850b37916afa2c44d..31a7555783b839dc9ce07d99a60b4feb99d8e274 100644 (file)
@@ -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 = auto_demangling;
 
   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)
              {
@@ -5137,7 +5139,7 @@ main (argc, argv)
            {
              int skip_first = 0;
 
-             if (mbuffer[0] == '.')
+             if (mbuffer[0] == '.' || mbuffer[0] == '$')
                ++skip_first;
              if (strip_underscore && mbuffer[skip_first] == '_')
                ++skip_first;
@@ -5146,7 +5148,7 @@ main (argc, argv)
                skip_first = i;
 
              mbuffer[i] = 0;
-
+             flags |= (int) style;
              result = cplus_demangle (mbuffer + skip_first, flags);
              if (result)
                {
This page took 0.023535 seconds and 4 git commands to generate.