diff options
author | John Gilmore <gnu@cygnus> | 1992-10-06 09:33:15 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-10-06 09:33:15 +0000 |
commit | b5af69c3366b775b8fbf2e4cd51c3e39cb9330da (patch) | |
tree | 0a42c4daa04315a301139ec6370444a5d16b406d /gdb/language.c | |
parent | 48ab6c0e1d3d4b2d8091d3e25b4a6c0dff270288 (diff) | |
download | gdb-b5af69c3366b775b8fbf2e4cd51c3e39cb9330da.zip gdb-b5af69c3366b775b8fbf2e4cd51c3e39cb9330da.tar.gz gdb-b5af69c3366b775b8fbf2e4cd51c3e39cb9330da.tar.bz2 |
* language.c, language.h: Move saved_language out to global
expected_language. Set expected_language when user expectation
changes.
* language.c (language_info): Don't print type/range checking gub.
* main.c (main): Set expected language.
(execute_command): Check against expected language.
* symfile.c (set_initial_language): Set expected language.
Diffstat (limited to 'gdb/language.c')
-rw-r--r-- | gdb/language.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/gdb/language.c b/gdb/language.c index 2ecb150..e835445 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -102,6 +102,11 @@ enum type_check type_check = type_check_off; const struct language_defn *current_language = &unknown_language_defn; enum language_mode language_mode = language_mode_auto; +/* The language that the user expects to be typing in (the language + of main(), or the last language we notified them about, or C). */ + +const struct language_defn *expected_language; + /* The list of supported languages. The list itself is malloc'd. */ static const struct language_defn **languages; @@ -176,6 +181,7 @@ modula-2 Use the Modula-2 language\n"); flang = get_frame_language(); if (flang!=language_unknown) set_language(flang); + expected_language = current_language; return; } else { /* Enter manual mode. Set the specified language. */ @@ -183,6 +189,7 @@ modula-2 Use the Modula-2 language\n"); current_language = languages[i]; set_type_range (); set_lang_str(); + expected_language = current_language; return; } } @@ -394,17 +401,25 @@ set_range_str() /* Print out the current language settings: language, range and type checking. If QUIETLY, print only what has changed. */ + void language_info (quietly) int quietly; { - /* FIXME: quietly is ignored at the moment. */ - printf("Current Language: %s\n",language); - show_language_command((char *)0, 1); - printf("Type checking: %s\n",type); - show_type_command((char *)0, 1); - printf("Range checking: %s\n",range); - show_range_command((char *)0, 1); + if (quietly && expected_language == current_language) + return; + + expected_language = current_language; + printf("Current language: %s\n",language); + show_language_command((char *)0, 1); + + if (!quietly) + { + printf("Type checking: %s\n",type); + show_type_command((char *)0, 1); + printf("Range checking: %s\n",range); + show_range_command((char *)0, 1); + } } /* Return the result of a binary operation. */ |