aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>1998-11-23 19:44:42 +0000
committerMichael Snyder <msnyder@vmware.com>1998-11-23 19:44:42 +0000
commite1dba9c442ff7224df77f419d72656314f62147b (patch)
treebf28c19ecd6ccae9587d053d64cc77301c639c3d /gdb/language.c
parent98760eab33f4963e075077cb094f9f195ca33d01 (diff)
downloadgdb-e1dba9c442ff7224df77f419d72656314f62147b.zip
gdb-e1dba9c442ff7224df77f419d72656314f62147b.tar.gz
gdb-e1dba9c442ff7224df77f419d72656314f62147b.tar.bz2
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.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gdb/language.c b/gdb/language.c
index 1c10026..db6d513 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -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)
/* 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 *