binutils-gdb/gdb/cli
Pedro Alves d3839ede05 "source", foreground execution commands, and target-async
Sourcing a GDB script that runs foreground execution commands in
succession fails if the target can async:

 Breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.base/source-execution.c:36
 36        func1 ();
 (gdb) source ../../../src/gdb/testsuite/gdb.base/source-execution.gdb
 ../../../src/gdb/testsuite/gdb.base/source-execution.gdb:21: Error in sourced command file:
 Cannot execute this command while the selected thread is running.
 (gdb) FAIL: gdb.base/source-execution.exp: source source-execution.gdb

That is, after a foreground execution command, GDB moves on to the
following command immediately before waiting for the previous command
to complete.

https://sourceware.org/ml/gdb-patches/2011-09/msg00037.html (b4a14fd0)
addressed this for command lists, Python's gdb.execute, etc., but
missed "source".  Fixed now in the same way.

gdb/
2014-03-25  Pedro Alves  <palves@redhat.com>

	* cli/cli-script.c (script_from_file): Force the interpreter to
	sync mode.

gdb/testsuite/
2014-03-25  Pedro Alves  <palves@redhat.com>
	    Doug Evans  <dje@google.com>

	* gdb.base/source-execution.c: New file.
	* gdb.base/source-execution.exp: New file.
	* gdb.base/source-execution.gdb: New file.
2014-03-25 11:45:53 +00:00
..
cli-cmds.c Add Guile as an extension language. 2014-02-09 19:40:01 -08:00
cli-cmds.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cli-decode.c convert flags to bitfields 2014-01-20 09:10:51 -07:00
cli-decode.h better packing for command struct 2014-01-20 09:10:52 -07:00
cli-dump.c replace XMALLOC with XNEW 2014-01-13 07:31:28 -07:00
cli-interp.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cli-logging.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cli-script.c "source", foreground execution commands, and target-async 2014-03-25 11:45:53 +00:00
cli-script.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cli-setshow.c remove deprecated_set_hook 2014-01-13 12:33:43 -07:00
cli-setshow.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
cli-utils.c Add a newline in output messages 2014-03-06 14:36:54 +08:00
cli-utils.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00