diff options
author | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-09-07 14:40:40 +0200 |
---|---|---|
committer | Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> | 2020-09-07 15:29:05 +0200 |
commit | 7f08fd5186df8c58135c8adb71772cfa3f93d405 (patch) | |
tree | 800d41cf992c0507dc2cae19413ce038bdb8312e | |
parent | d2a54558074287721ce9e47142f7fa92bda15531 (diff) | |
download | gdb-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.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/infrun.c | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 65fc955..788f4e6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +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. + 2020-09-06 Tom Tromey <tom@tromey.com> * symfile.h (dwarf2_free_objfile): Don't declare. 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); |