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.
This commit is contained in:
parent
a22429b98e
commit
47a80e9093
4 changed files with 32 additions and 1 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2011-01-31 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2011-01-31 Tom Tromey <tromey@redhat.com>
|
2011-01-31 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* infcmd.c (finish_backward): Use breakpoint_set_silent.
|
* infcmd.c (finish_backward): Use breakpoint_set_silent.
|
||||||
|
|
|
@ -355,6 +355,8 @@ extern void error_no_arg (char *) ATTRIBUTE_NORETURN;
|
||||||
|
|
||||||
extern void dont_repeat (void);
|
extern void dont_repeat (void);
|
||||||
|
|
||||||
|
extern struct cleanup *prevent_dont_repeat (void);
|
||||||
|
|
||||||
/* Used to mark commands that don't do anything. If we just leave the
|
/* Used to mark commands that don't do anything. If we just leave the
|
||||||
function field NULL, the command is interpreted as a help topic, or
|
function field NULL, the command is interpreted as a help topic, or
|
||||||
as a class of commands. */
|
as a class of commands. */
|
||||||
|
|
|
@ -375,6 +375,7 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
||||||
char *copy = xstrdup (arg);
|
char *copy = xstrdup (arg);
|
||||||
struct cleanup *cleanup = make_cleanup (xfree, copy);
|
struct cleanup *cleanup = make_cleanup (xfree, copy);
|
||||||
|
|
||||||
|
prevent_dont_repeat ();
|
||||||
if (to_string)
|
if (to_string)
|
||||||
result = execute_command_to_string (copy, from_tty);
|
result = execute_command_to_string (copy, from_tty);
|
||||||
else
|
else
|
||||||
|
|
20
gdb/top.c
20
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. */
|
/* Commands call this if they do not want to be repeated by null lines. */
|
||||||
|
|
||||||
void
|
void
|
||||||
dont_repeat (void)
|
dont_repeat (void)
|
||||||
{
|
{
|
||||||
if (server_command)
|
if (suppress_dont_repeat || server_command)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If we aren't reading from standard input, we are saving the last
|
/* If we aren't reading from standard input, we are saving the last
|
||||||
|
@ -560,6 +565,19 @@ dont_repeat (void)
|
||||||
if (instream == stdin)
|
if (instream == stdin)
|
||||||
*line = 0;
|
*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.
|
/* Read a line from the stream "instream" without command line editing.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue