aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/gdb/language.c b/gdb/language.c
index d697331..80f9b01 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -1,6 +1,6 @@
/* Multiple source language support for GDB.
- Copyright (C) 1991-2024 Free Software Foundation, Inc.
+ Copyright (C) 1991-2025 Free Software Foundation, Inc.
Contributed by the Department of Computer Science at the State University
of New York at Buffalo.
@@ -82,6 +82,9 @@ static const struct language_defn *global_current_language;
static lazily_set_language_ftype *lazy_language_setter;
enum language_mode language_mode = language_mode_auto;
+/* Whether to warn on language changes. */
+bool warn_frame_lang_mismatch = true;
+
/* See language.h. */
const struct language_defn *
@@ -168,7 +171,7 @@ show_language_command (struct ui_file *file, int from_tty,
_("The current source language is \"%s\".\n"),
current_language->name ());
- if (has_stack_frames ())
+ if (warn_frame_lang_mismatch && has_stack_frames ())
{
frame_info_ptr frame;
@@ -674,14 +677,6 @@ language_defn::is_string_type_p (struct type *type) const
return c_is_string_type_p (type);
}
-/* See language.h. */
-
-std::unique_ptr<compile_instance>
-language_defn::get_compile_instance () const
-{
- return {};
-}
-
/* The default implementation of the get_symbol_name_matcher_inner method
from the language_defn class. Matches with strncmp_iw. */
@@ -1100,9 +1095,7 @@ language_lookup_primitive_type_as_symbol (const struct language_defn *la,
/* Initialize the language routines. */
-void _initialize_language ();
-void
-_initialize_language ()
+INIT_GDB_FILE (language)
{
static const char *const type_or_range_names[]
= { "on", "off", "warn", "auto", NULL };
@@ -1144,5 +1137,15 @@ For Fortran the default is off; for other languages the default is on."),
show_case_command,
&setlist, &showlist);
+ add_setshow_boolean_cmd ("warn-language-frame-mismatch", class_obscure,
+ &warn_frame_lang_mismatch, _("\
+Enable or disable the frame language-mismatch warning."),
+ _("\
+Show the current setting of the frame language-mismatch warning."),
+ _("\
+The frame-language-mismatch warning is issued when the current language\n\
+does not match the selected frame's language."), nullptr, nullptr,
+ &setlist, &showlist);
+
add_set_language_command ();
}