aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>1996-02-05 20:50:26 +0000
committerTom Tromey <tromey@redhat.com>1996-02-05 20:50:26 +0000
commitfc71ad23ddd09cfc590e487eb3be266a11837465 (patch)
treee76ad3d5378b86a8733f507b39ae0e83b506f712 /gdb/language.c
parentcb62d2bc1edb6e9db09e055c18e4164cfc9bcc6a (diff)
downloadfsf-binutils-gdb-fc71ad23ddd09cfc590e487eb3be266a11837465.zip
fsf-binutils-gdb-fc71ad23ddd09cfc590e487eb3be266a11837465.tar.gz
fsf-binutils-gdb-fc71ad23ddd09cfc590e487eb3be266a11837465.tar.bz2
* language.c (set_language_command): Use languages table when
printing available languages.
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/gdb/language.c b/gdb/language.c
index b9c04ae..9f56066 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
whenever the working language changes. That would be a lot faster. */
#include "defs.h"
+#include <ctype.h>
#include "gdb_string.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
@@ -163,19 +164,31 @@ set_language_command (ignore, from_tty)
enum language flang;
char *err_lang;
- /* FIXME -- do this from the list, with HELP. */
- if (!language || !language[0]) {
- printf_unfiltered("The currently understood settings are:\n\n");
- printf_unfiltered ("local or auto Automatic setting based on source file\n");
- printf_unfiltered ("c Use the C language\n");
- printf_unfiltered ("c++ Use the C++ language\n");
- printf_unfiltered ("chill Use the Chill language\n");
- printf_unfiltered ("fortran Use the Fortran language\n");
- printf_unfiltered ("modula-2 Use the Modula-2 language\n");
- /* Restore the silly string. */
- set_language(current_language->la_language);
- return;
- }
+ if (!language || !language[0])
+ {
+ printf_unfiltered("The currently understood settings are:\n\n");
+ printf_unfiltered ("local or auto Automatic setting based on source file\n");
+
+ for (i = 0; i < languages_size; ++i)
+ {
+ /* Already dealt with these above. */
+ if (languages[i]->la_language == language_unknown
+ || languages[i]->la_language == language_auto)
+ continue;
+
+ /* FIXME for now assume that the human-readable name is just
+ a capitalization of the internal name. */
+ printf_unfiltered ("%-16s Use the %c%s language\n",
+ languages[i]->la_name,
+ /* Capitalize first letter of language
+ name. */
+ toupper (languages[i]->la_name[0]),
+ languages[i]->la_name + 1);
+ }
+ /* Restore the silly string. */
+ set_language(current_language->la_language);
+ return;
+ }
/* Search the list of languages for a match. */
for (i = 0; i < languages_size; i++) {