Make command-repeat work after gdb.execute
Since commit
56bcdbea2b
("Let gdb.execute handle multi-line commands")
command repetition after using the `gdb.execute` Python function
fails (the previous command is not repeated anymore). This happens
because read_command_lines_1 sets dont_repeat, but the call to
prevent_dont_repeat in execute_gdb_command is later.
The fix is to move the call to prevent_dont_repeat to the beginning of
the function.
Tested on my laptop (ArchLinux-x86_64).
gdb/ChangeLog:
PR python/23714
* gdb/python/python.c (execute_gdb_command): Call
prevent_dont_repeat earlier to avoid affecting dont_repeat.
gdb/testuite/ChangeLog:
PR python/23714
* gdb.python/python.exp: Test command repetition after
gdb.execute.
This commit is contained in:
parent
ca94519e70
commit
1c97054b87
4 changed files with 15 additions and 1 deletions
|
@ -583,6 +583,8 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
|||
|
||||
std::string to_string_res;
|
||||
|
||||
scoped_restore preventer = prevent_dont_repeat ();
|
||||
|
||||
TRY
|
||||
{
|
||||
struct interp *interp;
|
||||
|
@ -612,7 +614,6 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw)
|
|||
interp = interp_lookup (current_ui, "console");
|
||||
current_uiout = interp->interp_ui_out ();
|
||||
|
||||
scoped_restore preventer = prevent_dont_repeat ();
|
||||
if (to_string)
|
||||
to_string_res = execute_control_commands_to_string (lines.get (),
|
||||
from_tty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue