RFC: Move language-changed message to verbose

Daniel Jacobowitz drow@false.org
Mon Nov 2 19:20:00 GMT 2009


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.  */
 	}



More information about the Gdb-patches mailing list