gdb/infrun: use switch_to_target_no_thread to switch the target

Use the available `switch_to_target_no_thread` function to switch the
target.  This is a refactoring.

gdb/ChangeLog:
2020-09-07  Tankut Baris Aktemur  <tankut.baris.aktemur@intel.com>

	* infrun.c (fetch_inferior_event): Use
	`switch_to_target_no_thread` to switch the target.
This commit is contained in:
Tankut Baris Aktemur
2020-09-07 14:40:40 +02:00
parent d2a5455807
commit 7f08fd5186
2 changed files with 7 additions and 7 deletions

View File

@@ -3903,13 +3903,8 @@ fetch_inferior_event ()
gdb_assert (ecs->ws.kind != TARGET_WAITKIND_IGNORE);
/* Switch to the target that generated the event, so we can do
target calls. Any inferior bound to the target will do, so we
just switch to the first we find. */
for (inferior *inf : all_inferiors (ecs->target))
{
switch_to_inferior_no_thread (inf);
break;
}
target calls. */
switch_to_target_no_thread (ecs->target);
if (debug_infrun)
print_target_wait_results (minus_one_ptid, ecs->ptid, &ecs->ws);