set style line-number intensity VALUE
Control the styling of line numbers printed by GDB.
+set warn-language-frame-mismatch [on|off]
+show warn-language-frame-mismatch
+ Control the warning that is emitted when specifying a language that
+ does not match the current frame's language.
+
maintenance info inline-frames [ADDRESS]
New command which displays GDB's inline-frame information for the
current address, or for ADDRESS if specified. The output identifies
a different source language. Using @samp{set language auto} in this
case frees you from having to set the working language manually.
+The warning is enabled by default, but it can be controlled via a
+setting:
+
+@table @code
+@item set warn-language-frame-mismatch [on|off]
+@kindex warn-language-frame-mismatch
+Enable or disable the warning that is issued when the current language
+is set to a value that does not match the current frame.
+
+@item show warn-language-frame-mismatch
+Show whether the frame-mismatch warning will be issued.
+@end table
+
@node Show
@section Displaying the 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 *
_("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;
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 ();
}
extern const char lang_frame_mismatch_warn[];
+/* Controls whether to warn on a frame language mismatch. */
+
+extern bool warn_frame_lang_mismatch;
+
/* language_mode ==
language_mode_auto: current_language automatically set upon selection
of scope (e.g. stack frame)
# Try exercising the "minimal" language a bit...
if {[runto csub]} {
- gdb_test "set lang minimal" \
- "Warning: the current language does not match this frame." \
- "set lang to minimal"
+ # Also test warn-language-frame-mismatch.
+ gdb_test_no_output "set warn-language-frame-mismatch off"
+ gdb_test_no_output "set lang minimal" "set lang to minimal"
gdb_test "print x" " = 5000" "print parameter value"
# Try ambiguous settings.
gdb_test "with w" \
- "Ambiguous set command \"w\": watchdog, width, write\\."
+ "Ambiguous set command \"w\": warn-language-frame-mismatch, watchdog, width, write\\."
gdb_test "with print m" \
"Ambiguous set print command \"m\": max-depth, max-symbolic-offset, memory-tag-violations\\."
/* FIXME: This should be cacheing the frame and only running when
the frame changes. */
- if (has_stack_frames ())
+ if (warn_frame_lang_mismatch && has_stack_frames ())
{
enum language flang;