This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Move language-changed message to verbose

This patch implements the behavior I described in:

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

2009-11-02  Daniel Jacobowitz  <>

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]