Make command-repeat work after gdb.execute
authorBenno Fünfstück <benno.fuenfstueck@gmail.com>
Wed, 21 Nov 2018 17:16:25 +0000 (17:16 +0000)
committerPedro Alves <palves@redhat.com>
Wed, 21 Nov 2018 17:16:25 +0000 (17:16 +0000)
commit7d9e516326ff542b3c9c85a3c08be2622d9126b6
treef96c0fc5792c55ed8c779d95c78a83c6f34dae9f
parent646f353b1661aae823e549bb7840a78c85053a54
Make command-repeat work after gdb.execute

Since commit

  56bcdbea2bed ("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.
gdb/ChangeLog
gdb/python/python.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/python.exp