mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-16 20:32:21 +08:00
* main.c (main): Move code that sets initial language to
symfile.c. Fixup places where command files are processed to be consistent in setting a default language if none has been previously set. * symfile.c (set_initial_language): Add code moved from main() that sets an initial default language when a new symbol file is read. * symfile.c (symbol_file_command): Call set_initial_language. * symtab.c (find_main_psymtab): Add FIXME comment.
This commit is contained in:
@ -1,3 +1,15 @@
|
|||||||
|
Sat Sep 19 09:52:26 1992 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
|
* main.c (main): Move code that sets initial language to
|
||||||
|
symfile.c. Fixup places where command files are processed to
|
||||||
|
be consistent in setting a default language if none has been
|
||||||
|
previously set.
|
||||||
|
* symfile.c (set_initial_language): Add code moved from
|
||||||
|
main() that sets an initial default language when a new
|
||||||
|
symbol file is read.
|
||||||
|
* symfile.c (symbol_file_command): Call set_initial_language.
|
||||||
|
* symtab.c (find_main_psymtab): Add FIXME comment.
|
||||||
|
|
||||||
Wed Sep 16 22:31:55 1992 K. Richard Pixley (rich@sendai.cygnus.com)
|
Wed Sep 16 22:31:55 1992 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||||
|
|
||||||
* breakpoint.c, sparc-tdep.c: comment changes.
|
* breakpoint.c, sparc-tdep.c: comment changes.
|
||||||
|
52
gdb/main.c
52
gdb/main.c
@ -767,25 +767,6 @@ GDB manual (available as on-line info or a printed manual).\n", stderr);
|
|||||||
error_pre_print = "\n";
|
error_pre_print = "\n";
|
||||||
warning_pre_print = "\nwarning: ";
|
warning_pre_print = "\nwarning: ";
|
||||||
|
|
||||||
/* Set the initial language. */
|
|
||||||
{
|
|
||||||
struct partial_symtab *pst = find_main_psymtab ();
|
|
||||||
enum language lang = language_unknown;
|
|
||||||
if (pst == NULL) ;
|
|
||||||
#if 0
|
|
||||||
/* A better solution would set the language when reading the psymtab.
|
|
||||||
This would win for symbol file formats that encode the langauge,
|
|
||||||
such as DWARF. But, we don't do that yet. FIXME */
|
|
||||||
else if (pst->language != language_unknown)
|
|
||||||
lang = pst->language;
|
|
||||||
#endif
|
|
||||||
else if (pst->filename != NULL)
|
|
||||||
lang = deduce_language_from_filename (pst->filename);
|
|
||||||
if (lang == language_unknown) /* Make C the default language */
|
|
||||||
lang = language_c;
|
|
||||||
set_language (lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (corearg != NULL)
|
if (corearg != NULL)
|
||||||
if (!setjmp (to_top_level))
|
if (!setjmp (to_top_level))
|
||||||
core_file_command (corearg, !batch);
|
core_file_command (corearg, !batch);
|
||||||
@ -812,19 +793,30 @@ GDB manual (available as on-line info or a printed manual).\n", stderr);
|
|||||||
if (!homedir
|
if (!homedir
|
||||||
|| memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
|
|| memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat)))
|
||||||
if (!inhibit_gdbinit && access (gdbinit, R_OK) == 0)
|
if (!inhibit_gdbinit && access (gdbinit, R_OK) == 0)
|
||||||
if (!setjmp (to_top_level))
|
{
|
||||||
source_command (gdbinit, 0);
|
/* If no language has been set yet, default to C. */
|
||||||
do_cleanups (ALL_CLEANUPS);
|
if (current_language->la_language == language_unknown)
|
||||||
|
set_language (language_c);
|
||||||
|
if (!setjmp (to_top_level))
|
||||||
|
source_command (gdbinit, 0);
|
||||||
|
}
|
||||||
|
do_cleanups (ALL_CLEANUPS);
|
||||||
|
|
||||||
for (i = 0; i < ncmd; i++)
|
for (i = 0; i < ncmd; i++)
|
||||||
if (!setjmp (to_top_level))
|
{
|
||||||
{
|
/* If no language has been set yet, default to C. For consistency with
|
||||||
if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0')
|
other places, we redo this each time before sourcing commands. */
|
||||||
read_command_file (stdin);
|
if (current_language->la_language == language_unknown)
|
||||||
else
|
set_language (language_c);
|
||||||
source_command (cmdarg[i], !batch);
|
if (!setjmp (to_top_level))
|
||||||
do_cleanups (ALL_CLEANUPS);
|
{
|
||||||
}
|
if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0')
|
||||||
|
read_command_file (stdin);
|
||||||
|
else
|
||||||
|
source_command (cmdarg[i], !batch);
|
||||||
|
do_cleanups (ALL_CLEANUPS);
|
||||||
|
}
|
||||||
|
}
|
||||||
free ((PTR)cmdarg);
|
free ((PTR)cmdarg);
|
||||||
|
|
||||||
/* Read in the old history after all the command files have been read. */
|
/* Read in the old history after all the command files have been read. */
|
||||||
|
Reference in New Issue
Block a user