summaryrefslogtreecommitdiffstats
path: root/gdb/main.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-11-21 18:42:05 +0000
committerJohn Gilmore <gnu@cygnus>1991-11-21 18:42:05 +0000
commit7d9884b92772d5b4fa0de57de5caca2d9308c16c (patch)
tree061a8482b03bad9fd11d08bec0cc8e14ad99b839 /gdb/main.c
parentd51bea8d2c6f8392d6a981c7293aee126e5914d5 (diff)
downloadppe42-binutils-7d9884b92772d5b4fa0de57de5caca2d9308c16c.tar.gz
ppe42-binutils-7d9884b92772d5b4fa0de57de5caca2d9308c16c.zip
* defs.h: Incorporate param.h. All users changed.
* param-no-tm.h: Change users to define TM_FILE_OVERRIDE instead. * param.h, param-no-tm.h: Removed. * Update copyrights in all changed files. * dbxread.c, dwarfread.c, inflow.c, infrun.c, m2-exp.y, putenv.c, solib.c, symtab.h, tm-umax.h, valprint.c: Lint. * tm-convex.h, tm-hp300hpux.h, tm-merlin.h, tm-sparc.h, xm-merlin.h: Avoid host include files in target descriptions. * getpagesize.h: Removed, libiberty copes now.
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 936879cf00..e36d730510 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1,5 +1,5 @@
-/* Top level for GDB, the GNU debugger.
- Copyright (C) 1986, 1987, 1988, 1989, 1990 Free Software Foundation, Inc.
+/* Top level `main' program for GDB, the GNU debugger.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
This file is part of GDB.
@@ -21,7 +21,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
int fclose ();
#include "defs.h"
#include "gdbcmd.h"
-#include "param.h"
#include "symtab.h"
#include "inferior.h"
#include "signals.h"
@@ -604,6 +603,27 @@ GDB manual (available as on-line info or a printed manual).\n", stderr);
printf_filtered ("\n");
error_pre_print = "\n";
+ /* Set the initial language. */
+ {
+ extern enum language deduce_language_from_filename ();
+ extern struct partial_symtab *find_main_psymtab ();
+ 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 (!setjmp (to_top_level))
core_file_command (corearg, !batch);
@@ -1685,7 +1705,7 @@ cd_command (dir, from_tty)
current_directory = dir;
else
{
- current_directory = concat (current_directory, "/", dir);
+ current_directory = concat (current_directory, "/", dir, NULL);
free (dir);
}
@@ -2021,7 +2041,7 @@ initialize_history()
/* We include the current directory so that if the user changes
directories the file written will be the same as the one
that was read. */
- history_filename = concat (current_directory, "/.gdb_history", "");
+ history_filename = concat (current_directory, "/.gdb_history", NULL);
}
read_history (history_filename);
}
OpenPOWER on IntegriCloud