This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFC: Move language-changed message to verbose
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Mon, 2 Nov 2009 14:20:00 -0500
- Subject: RFC: Move language-changed message to verbose
This patch implements the behavior I described in:
http://sourceware.org/ml/gdb/2009-04/msg00039.html
with Eli's suggested change. The language change message is only
displayed if verbose; it is also fixed, since I discovered the version
there is off-by-one. The selected frame is not set until the
following if statement, and current_language is set as a byproduct of
finding the selected frame.
Any comments on this patch?
Tested on x86_64-linux, no regressions.
--
Daniel Jacobowitz
CodeSourcery
2009-11-02 Daniel Jacobowitz <dan@codesourcery.com>
* top.c (execute_command): Select a frame before checking the current
language. Only output a message if verbose.
--- gdb/top.c (revision 243540)
+++ gdb/top.c (revision 243541)
@@ -461,10 +461,13 @@ Cannot execute this command without a li
}
- /* Tell the user if the language has changed (except first time). */
+ /* Tell the user if the language has changed (except first time).
+ First make sure that a new frame has been selected, in case this
+ command or the hooks changed the program state. */
+ deprecated_safe_get_selected_frame ();
if (current_language != expected_language)
{
- if (language_mode == language_mode_auto)
+ if (language_mode == language_mode_auto && info_verbose)
{
language_info (1); /* Print what changed. */
}