From 7f08fd5186df8c58135c8adb71772cfa3f93d405 Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Mon, 7 Sep 2020 14:40:40 +0200 Subject: [PATCH] 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 * infrun.c (fetch_inferior_event): Use `switch_to_target_no_thread` to switch the target. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 65fc9550dd3..788f4e6014d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2020-09-07 Tankut Baris Aktemur + + * infrun.c (fetch_inferior_event): Use + `switch_to_target_no_thread` to switch the target. + 2020-09-06 Tom Tromey * symfile.h (dwarf2_free_objfile): Don't declare. diff --git a/gdb/infrun.c b/gdb/infrun.c index 938bc081a1c..82ec30086a9 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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); -- 2.30.2