diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-18 20:10:43 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-05-04 15:58:09 -0600 |
commit | 56bcdbea2bed27ea83bf0e4fe472ab744b4beaa1 (patch) | |
tree | 8d7b32e4411b6a6f73e51fde7b20f0489d685dc2 /gdb/testsuite | |
parent | a913fffbdee21fdd50e8de0596358be425775678 (diff) | |
download | binutils-56bcdbea2bed27ea83bf0e4fe472ab744b4beaa1.zip binutils-56bcdbea2bed27ea83bf0e4fe472ab744b4beaa1.tar.gz binutils-56bcdbea2bed27ea83bf0e4fe472ab744b4beaa1.tar.bz2 |
Let gdb.execute handle multi-line commands
This changes the Python API so that gdb.execute can now handle
multi-line commands, like "commands" or "define".
ChangeLog
2018-05-04 Tom Tromey <tom@tromey.com>
PR python/22730:
* NEWS: Mention gdb.execute change.
* gdbcmd.h (execute_control_command): Don't declare.
* python/python.c (execute_gdb_command): Use read_command_lines_1,
execute_control_commands, execute_control_commands_to_string.
* cli/cli-script.h (execute_control_commands)
(execute_control_commands_to_string): Declare.
(execute_control_command): Add from_tty parameter.
* cli/cli-script.c (execute_control_commands)
(execute_control_commands_to_string): New functions.
(execute_user_command): Use execute_control_commands.
(execute_control_command_1): Add "from_tty" parameter. Update.
(execute_control_command): Likewise.
testsuite/ChangeLog
2018-05-04 Tom Tromey <tom@tromey.com>
PR python/22730:
* gdb.python/python.exp: Test multi-line execute.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 24d9d34..761fb73 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-05-04 Tom Tromey <tom@tromey.com> + PR python/22730: + * gdb.python/python.exp: Test multi-line execute. + +2018-05-04 Tom Tromey <tom@tromey.com> + PR python/22731: * gdb.python/py-breakpoint.exp: Test setting breakpoint commands. diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index cee195f..f6bf93a 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -119,6 +119,9 @@ gdb_test_no_output \ "python x = gdb.execute('printf \"%d\", 23', to_string = True)" gdb_test "python print (x)" "23" +gdb_test "python gdb.execute('echo 2\\necho 3\\\\n\\n')" "23" \ + "multi-line execute" + # Test post_event. gdb_py_test_multiple "post event insertion" \ "python" "" \ |