aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-01-03 04:23:46 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-01-03 04:23:46 +0000
commit8b60591b5d040469131bb6a64301df2207039ee5 (patch)
tree64213e8efc92a7050f030436e25630f4dc6f53db /gdb
parenta97fced3146726dc86196b91587610392952f234 (diff)
downloadfsf-binutils-gdb-8b60591b5d040469131bb6a64301df2207039ee5.zip
fsf-binutils-gdb-8b60591b5d040469131bb6a64301df2207039ee5.tar.gz
fsf-binutils-gdb-8b60591b5d040469131bb6a64301df2207039ee5.tar.bz2
* symfile.c (set_initial_language): Make non-static.
* symfile.h (set_initial_language): Add declaration. * language.c: #include "symfile.h". (set_language): Call set_initial_language if the frame language could not be determined.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/language.c6
-rw-r--r--gdb/symfile.c4
-rw-r--r--gdb/symfile.h2
4 files changed, 16 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 484e57c..aaf9eb9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2008-01-03 Joel Brobecker <brobecker@adacore.com>
+
+ * symfile.c (set_initial_language): Make non-static.
+ * symfile.h (set_initial_language): Add declaration.
+ * language.c: #include "symfile.h".
+ (set_language): Call set_initial_language if the frame language
+ could not be determined.
+
2008-01-03 Paul N. Hilfinger <hilfinger@adacore.com>
* eval.c (evaluate_subexp_for_address): Provide frame address to
diff --git a/gdb/language.c b/gdb/language.c
index 63af6c3..cc94546 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -43,6 +43,7 @@
#include "parser-defs.h"
#include "jv-lang.h"
#include "demangle.h"
+#include "symfile.h"
extern void _initialize_language (void);
@@ -185,11 +186,14 @@ local or auto Automatic setting based on source file\n"));
/* Found it! Go into manual mode, and use this language. */
if (languages[i]->la_language == language_auto)
{
- /* Enter auto mode. Set to the current frame's language, if known. */
+ /* Enter auto mode. Set to the current frame's language, if
+ known, or fallback to the initial language. */
language_mode = language_mode_auto;
flang = get_frame_language ();
if (flang != language_unknown)
set_language (flang);
+ else
+ set_initial_language ();
expected_language = current_language;
return;
}
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 1066b52..1417d96 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -87,8 +87,6 @@ static int simple_read_overlay_region_table (void);
static void simple_free_overlay_region_table (void);
#endif
-static void set_initial_language (void);
-
static void load_command (char *, int);
static void symbol_file_add_main_1 (char *args, int from_tty, int flags);
@@ -1576,7 +1574,7 @@ symbol_file_command (char *args, int from_tty)
stabs we find, but we can't do that until later when we read in
full symbols. */
-static void
+void
set_initial_language (void)
{
struct partial_symtab *pst;
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 229576b..5ff53f8 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -292,6 +292,8 @@ extern int auto_solib_limit;
/* From symfile.c */
+extern void set_initial_language (void);
+
extern struct partial_symtab *allocate_psymtab (char *, struct objfile *);
extern void discard_psymtab (struct partial_symtab *);