gdb: make target_close check that the target isn't pushed in all inferiors
The target_close function currently checks that the target to be closed
isn't pushed in the current inferior:
gdb_assert (!current_inferior ()->target_is_pushed (targ));
Normally, a target is closed when its refcount has dropped to 0, due to
not being used in any inferior anymore. I think it would make sense to
change that assert to not only check in the current inferior, but to
check in all inferiors. It would be quite bad (and a bug) to close a
target while it's still pushed in one of the non-current inferiors.
gdb/ChangeLog:
* target.c (target_close): Check in all inferiors that the
target is not pushed.
Change-Id: I6e37fc3f3476a0593da1e476604642b2de90f1d5