gdb: multi-line support for "document" command

"document" command executed in python, gdb.execute("document
<comname>\n...\nend\n"), will wait for user input. Python extension stops
working from that point.

multi-line suport was introduced in commit 56bcdbea2. But "document" support
seem to be implemented.

gdb/ChangeLog:

2020-12-02  Rae Kim  <rae.kim@gmail.com>

	* cli/cli-script.c (do_document_command): Rename from
	document_command. Handle multi-line input.
	(multi_line_command_p): Handle document_control.
	(build_command_line): Likewise.
	(execute_control_command_1): Likewise.
	(process_next_line): Likewise.
	(document_command): Call do_document_command.
	* cli/cli-script.h (enum command_control_type): Add
	document_control.

gdb/testsuite/ChangeLog:

2020-12-02  Rae Kim  <rae.kim@gmail.com>
	* gdb.base/document.exp: New test.

Change-Id: Ice262b980c05051de4c106af9f3fde5b2a6df6fe
This commit is contained in:
Rae Kim 2020-12-15 22:51:09 -05:00 committed by Simon Marchi
parent efd7ff149a
commit a33fc9aed4
5 changed files with 89 additions and 7 deletions

View file

@ -45,6 +45,7 @@ enum command_control_type
guile_control,
while_stepping_control,
define_control,
document_control,
invalid_control
};