diff options
author | Pedro Alves <palves@redhat.com> | 2020-01-10 20:05:47 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2020-01-10 20:05:47 +0000 |
commit | db2d40f7d0b8477ca5ad9e305b8137a085434c97 (patch) | |
tree | bce10d93633a8fe79fa2e14e994f9b89799bf922 /gdb/mi | |
parent | bd420a2dfff64978feb1659d3b77c7601b98463f (diff) | |
download | gdb-db2d40f7d0b8477ca5ad9e305b8137a085434c97.zip gdb-db2d40f7d0b8477ca5ad9e305b8137a085434c97.tar.gz gdb-db2d40f7d0b8477ca5ad9e305b8137a085434c97.tar.bz2 |
Introduce switch_to_inferior_no_thread
Several places want to switch context to an inferior and its pspace,
while at the same time switch to "no thread selected". This commit
adds a function that does that, and uses it in a few places.
gdb/ChangeLog:
2020-01-10 Pedro Alves <palves@redhat.com>
* inferior.c (switch_to_inferior_no_thread): New function,
factored out from ...
(inferior_command): ... here.
* inferior.h (switch_to_inferior_no_thread): Declare.
* mi/mi-main.c (run_one_inferior): Use
switch_to_inferior_no_thread.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index e677381..24daf3f 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -414,11 +414,7 @@ run_one_inferior (struct inferior *inf, void *arg) switch_to_thread (tp); } else - { - set_current_inferior (inf); - switch_to_no_thread (); - set_current_program_space (inf->pspace); - } + switch_to_inferior_no_thread (inf); mi_execute_cli_command (run_cmd, async_p, async_p ? "&" : NULL); return 0; |