diff options
author | Fred Fish <fnf@specifix.com> | 1992-09-20 15:45:52 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-09-20 15:45:52 +0000 |
commit | 538280d81e79d0da154c4af8beef1dd491ae71a2 (patch) | |
tree | 4575fda93b803ee8d560ae986edb59b7d31c4931 | |
parent | d75710b02c7dc0bef0c9a36f0976e7ac2fe6d660 (diff) | |
download | binutils-538280d81e79d0da154c4af8beef1dd491ae71a2.zip binutils-538280d81e79d0da154c4af8beef1dd491ae71a2.tar.gz binutils-538280d81e79d0da154c4af8beef1dd491ae71a2.tar.bz2 |
* main.c (main): Back out previous language setting changes.
Replace with simple default to C before processing any init
files. There MUST be a language set, even in the absence of
init files or executables, or expression parsing fails.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/main.c | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6d13c79..df5e8bf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Sep 20 08:42:12 1992 Fred Fish (fnf@cygnus.com) + + * main.c (main): Back out previous language setting changes. + Replace with simple default to C before processing any init + files. There MUST be a language set, even in the absence of + init files or executables, or expression parsing fails. + Sat Sep 19 09:52:26 1992 Fred Fish (fnf@cygnus.com) * main.c (main): Move code that sets initial language to @@ -685,6 +685,11 @@ GDB manual (available as on-line info or a printed manual).\n", stderr); /* We may get more than one warning, don't double space all of them... */ warning_pre_print = "\nwarning: "; + /* We need a default language for parsing expressions, so simple things like + "set width 0" won't fail if no language is explicitly set in a config file + or implicitly set by reading an executable during startup. */ + set_language (language_c); + /* Read and execute $HOME/.gdbinit file, if it exists. This is done *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are @@ -699,8 +704,6 @@ GDB manual (available as on-line info or a printed manual).\n", stderr); strcat (homeinit, gdbinit); if (!inhibit_gdbinit && access (homeinit, R_OK) == 0) { - /* The official language of expressions in $HOME/.gdbinit is C. */ - set_language (language_c); if (!setjmp (to_top_level)) source_command (homeinit, 0); } @@ -794,9 +797,6 @@ GDB manual (available as on-line info or a printed manual).\n", stderr); || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) if (!inhibit_gdbinit && access (gdbinit, R_OK) == 0) { - /* If no language has been set yet, default to C. */ - if (current_language->la_language == language_unknown) - set_language (language_c); if (!setjmp (to_top_level)) source_command (gdbinit, 0); } @@ -804,10 +804,6 @@ GDB manual (available as on-line info or a printed manual).\n", stderr); for (i = 0; i < ncmd; i++) { - /* If no language has been set yet, default to C. For consistency with - other places, we redo this each time before sourcing commands. */ - if (current_language->la_language == language_unknown) - set_language (language_c); if (!setjmp (to_top_level)) { if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0') |