Fix -exec-run not running asynchronously with mi-async on (PR gdb/18077)
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 17 May 2016 20:44:57 +0000 (16:44 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 17 May 2016 20:46:18 +0000 (16:46 -0400)
commit61c6156df6e3c638eb3bdb4a6e3d418a43a6eb70
tree6933e658997e4d545c575efc90d9dddf19519904
parent01739a3b6a564f6552acf6c01617aa21ab4d8833
Fix -exec-run not running asynchronously with mi-async on (PR gdb/18077)

When doing -exec-run on a freshly started GDB, the only target on the
target stack at the time the dummy one.  When mi_async_p is called to
know whether the run should be async, it queries whether the current
target (dummy) supports async, and the answer is no.  The fix is to make
the code query the target that will be used for the run, which is not
necessarily the current target.

No regressions in the gdb.mi directory using the unix, native-gdbserver
and native-extended-gdbserver boards.  The test doesn't pass when
forcing maint set target-async off, obviously, since it makes mi-async
have no effect.  It doesn't seem like other tests are checking for that
eventuality, so I didn't in the new test.

gdb/ChangeLog:

* mi/mi-main.c (run_one_inferior): Use run target to determine
whether to run async or not.
(mi_cmd_exec_run): Likewise.

gdb/testsuite/ChangeLog:

* gdb.mi/mi-async-run.exp: New file.
* gdb.mi/mi-async-run.c: New file.
gdb/ChangeLog
gdb/mi/mi-main.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi-async-run.c [new file with mode: 0644]
gdb/testsuite/gdb.mi/mi-async-run.exp [new file with mode: 0644]
This page took 0.02775 seconds and 4 git commands to generate.