Mon Nov 23 11:38:40 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
authorMichael Snyder <msnyder@vmware.com>
Mon, 23 Nov 1998 19:44:42 +0000 (19:44 +0000)
committerMichael Snyder <msnyder@vmware.com>
Mon, 23 Nov 1998 19:44:42 +0000 (19:44 +0000)
        * symfile.c (deduce_language_from_filename): rewrite so as to
        work from a table of filename extensions, modifiable by the user.
        (filename_language_table): new data structure.
        (set_ext_lang_command): new function for new command, "set
        extension-language".  (info_extension_language_command): new
        function for new command "info extension-languages".
        (add_filename_language, init_filename_language_table): new
        support functions for the above.
        * language.c (language_enum): new function.  Support for above.

gdb/ChangeLog
gdb/language.c

index 03bab36b7a815f89f900127adb0c5e9843d8e04e..9bcc2cd0d506cf6a1ede61b0ca3bd34ea030dc24 100644 (file)
@@ -1,3 +1,15 @@
+Mon Nov 23 11:38:40 1998  Michael Snyder  <msnyder@cleaver.cygnus.com>
+
+       * symfile.c (deduce_language_from_filename): rewrite so as to 
+       work from a table of filename extensions, modifiable by the user.
+       (filename_language_table): new data structure.
+       (set_ext_lang_command): new function for new command, "set
+       extension-language".  (info_extension_language_command): new
+       function for new command "info extension-languages".
+       (add_filename_language, init_filename_language_table): new
+       support functions for the above.
+       * language.c (language_enum): new function.  Support for above.
+
 Mon Nov 23 10:47:54 1998  Andrew Cagney  <cagney@chook.cygnus.com>
 
        * config/sh/tm-sh.h, config/mn10200/tm-mn10200.h,
index 1c10026f813a7eb97e9fe381f8d7dc3d7b3e70c1..db6d513730aa88d92bb3597b7c64312083ea16b1 100644 (file)
@@ -166,9 +166,9 @@ show_language_command (ignore, from_tty)
 
    flang = get_frame_language();
    if (flang != language_unknown &&
-      language_mode == language_mode_manual &&
-      current_language->la_language != flang)
-      printf_filtered("%s\n",lang_frame_mismatch_warn);
+       language_mode == language_mode_manual &&
+       current_language->la_language != flang)
+     printf_filtered("%s\n",lang_frame_mismatch_warn);
 }
 
 /* Set command.  Change the current working language. */
@@ -1123,6 +1123,21 @@ range_error (va_alist)
 \f
 /* This page contains miscellaneous functions */
 
+/* Return the language enum for a given language string. */
+
+enum language
+language_enum (str)
+     char *str;
+{
+  int i;
+
+  for (i = 0; i < languages_size; i++) 
+    if (STREQ (languages[i]->la_name, str))
+      return languages[i]->la_language;
+
+  return language_unknown;
+}
+
 /* Return the language struct for a given language enum. */
 
 const struct language_defn *