aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-09-07 14:40:40 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2020-09-07 15:29:05 +0200
commit7f08fd5186df8c58135c8adb71772cfa3f93d405 (patch)
tree800d41cf992c0507dc2cae19413ce038bdb8312e /gdb/infrun.c
parentd2a54558074287721ce9e47142f7fa92bda15531 (diff)
downloadgdb-7f08fd5186df8c58135c8adb71772cfa3f93d405.zip
gdb-7f08fd5186df8c58135c8adb71772cfa3f93d405.tar.gz
gdb-7f08fd5186df8c58135c8adb71772cfa3f93d405.tar.bz2
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.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 938bc08..82ec300 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);