Move logic out of symbol_find_demangled_name
[deliverable/binutils-gdb.git] / gdb / defs.h
index b81de46fee17c9a120620f63fdec94d2326c17f0..5088390e2ca78bf21f102419833c088866e18e20 100644 (file)
@@ -194,26 +194,36 @@ extern void quit_serial_event_clear (void);
 /* * Languages represented in the symbol table and elsewhere.
    This should probably be in language.h, but since enum's can't
    be forward declared to satisfy opaque references before their
-   actual definition, needs to be here.  */
+   actual definition, needs to be here.
+
+   The constants here are in priority order.  In particular,
+   demangling is attempted according to this order.
+
+   Note that there's ambiguity between the mangling schemes of some of
+   these languages, so some symbols could be successfully demangled by
+   several languages.  For that reason, the constants here are sorted
+   in the order we'll attempt demangling them.  For example: Java and
+   Rust use C++ mangling, so must come after C++; Ada must come last
+   (see ada_sniff_from_mangled_name).  */
 
 enum language
   {
     language_unknown,          /* Language not known */
     language_auto,             /* Placeholder for automatic setting */
     language_c,                        /* C */
+    language_objc,             /* Objective-C */
     language_cplus,            /* C++ */
+    language_java,             /* Java */
     language_d,                        /* D */
     language_go,               /* Go */
-    language_objc,             /* Objective-C */
-    language_java,             /* Java */
     language_fortran,          /* Fortran */
     language_m2,               /* Modula-2 */
     language_asm,              /* Assembly language */
     language_pascal,           /* Pascal */
-    language_ada,              /* Ada */
     language_opencl,           /* OpenCL */
     language_rust,             /* Rust */
     language_minimal,          /* All other languages, minimal support only */
+    language_ada,              /* Ada */
     nr_languages
   };
 
This page took 0.024463 seconds and 4 git commands to generate.