*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / top.c
index c380ac9ed451b3863e1c078cc0b59f6a78a9da7a..beb1d9666f05f52e8b37d081b79cd0c410b9a6f7 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -8,7 +8,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "gdbcmd.h"
@@ -271,11 +269,6 @@ void (*deprecated_detach_hook) (void);
 
 void (*deprecated_interactive_hook) (void);
 
-/* Called when the registers have changed, as a hint to a GUI
-   to minimize window update. */
-
-void (*deprecated_registers_changed_hook) (void);
-
 /* Tell the GUI someone changed the register REGNO. -1 means
    that the caller does not know which register changed or
    that several registers have changed (see value_assign). */
@@ -552,9 +545,9 @@ command_loop (void)
          long space_now = lim - lim_at_start;
          long space_diff = space_now - space_at_cmd_start;
 
-         printf_unfiltered (_("Space used: %ld (%c%ld for this command)\n"),
+         printf_unfiltered (_("Space used: %ld (%s%ld for this command)\n"),
                             space_now,
-                            (space_diff >= 0 ? '+' : '-'),
+                            (space_diff >= 0 ? "+" : ""),
                             space_diff);
 #endif
        }
@@ -756,12 +749,16 @@ gdb_readline_wrapper_line (char *line)
   /* Prevent operate-and-get-next from acting too early.  */
   saved_after_char_processing_hook = after_char_processing_hook;
   after_char_processing_hook = NULL;
+
+  /* Prevent parts of the prompt from being redisplayed if annotations
+     are enabled, and readline's state getting out of sync.  */
+  if (async_command_editing_p)
+    rl_callback_handler_remove ();
 }
 
 struct gdb_readline_wrapper_cleanup
   {
     void (*handler_orig) (char *);
-    char *prompt_orig;
     int already_prompted_orig;
   };
 
@@ -771,7 +768,6 @@ gdb_readline_wrapper_cleanup (void *arg)
   struct gdb_readline_wrapper_cleanup *cleanup = arg;
 
   rl_already_prompted = cleanup->already_prompted_orig;
-  PROMPT (0) = cleanup->prompt_orig;
 
   gdb_assert (input_handler == gdb_readline_wrapper_line);
   input_handler = cleanup->handler_orig;
@@ -795,14 +791,12 @@ gdb_readline_wrapper (char *prompt)
   cleanup->handler_orig = input_handler;
   input_handler = gdb_readline_wrapper_line;
 
-  cleanup->prompt_orig = get_prompt ();
-  PROMPT (0) = prompt;
   cleanup->already_prompted_orig = rl_already_prompted;
 
   back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
 
   /* Display our prompt and prevent double prompt display.  */
-  display_gdb_prompt (NULL);
+  display_gdb_prompt (prompt);
   rl_already_prompted = 1;
 
   if (after_char_processing_hook)
@@ -1097,8 +1091,8 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
            }
          strcpy (linebuffer, history_value);
          p = linebuffer + strlen (linebuffer);
-         xfree (history_value);
        }
+      xfree (history_value);
     }
 
   /* If we just got an empty line, and that is supposed
@@ -1161,10 +1155,10 @@ print_gdb_version (struct ui_file *stream)
      there is no warranty. */
 
   fprintf_filtered (stream, "\
-GDB is free software, covered by the GNU General Public License, and you are\n\
-welcome to change it and/or distribute copies of it under certain conditions.\n\
-Type \"show copying\" to see the conditions.\n\
-There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n");
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
+This is free software: you are free to change and redistribute it.\n\
+There is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\n\
+and \"show warranty\" for details.\n");
 
   /* After the required info we print the configuration information. */
 
This page took 0.025128 seconds and 4 git commands to generate.