aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-01-31 16:52:35 +0000
committerTom Tromey <tromey@redhat.com>2011-01-31 16:52:35 +0000
commit47a80e909327f6be0451b7792162266e6695f23d (patch)
tree3d37f5644de9db00bdff6e4bc07daae1a5f0bcda /gdb/top.c
parenta22429b98e4c117b40f9693585c546067d9a4c0e (diff)
downloadgdb-47a80e909327f6be0451b7792162266e6695f23d.zip
gdb-47a80e909327f6be0451b7792162266e6695f23d.tar.gz
gdb-47a80e909327f6be0451b7792162266e6695f23d.tar.bz2
PR python/12216:
* python/python.c (execute_gdb_command): Call prevent_dont_repeat. * top.c (suppress_dont_repeat): New global. (dont_repeat): Use it. (prevent_dont_repeat): New function. * command.h (prevent_dont_repeat): Declare.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gdb/top.c b/gdb/top.c
index d14f308..df2b163 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -546,12 +546,17 @@ command_loop (void)
}
}
+/* When nonzero, cause dont_repeat to do nothing. This should only be
+ set via prevent_dont_repeat. */
+
+static int suppress_dont_repeat = 0;
+
/* Commands call this if they do not want to be repeated by null lines. */
void
dont_repeat (void)
{
- if (server_command)
+ if (suppress_dont_repeat || server_command)
return;
/* If we aren't reading from standard input, we are saving the last
@@ -560,6 +565,19 @@ dont_repeat (void)
if (instream == stdin)
*line = 0;
}
+
+/* Prevent dont_repeat from working, and return a cleanup that
+ restores the previous state. */
+
+struct cleanup *
+prevent_dont_repeat (void)
+{
+ struct cleanup *result = make_cleanup_restore_integer (&suppress_dont_repeat);
+
+ suppress_dont_repeat = 1;
+ return result;
+}
+
/* Read a line from the stream "instream" without command line editing.