#include "gdbsupport/byte-vector.h"
#include "terminal.h"
#include <unordered_map>
+#include "target-connection.h"
static void generic_tls_error (void) ATTRIBUTE_NORETURN;
{
t->decref ();
if (t->refcount () == 0)
- target_close (t);
+ {
+ if (t->stratum () == process_stratum)
+ connection_list_remove (as_process_stratum_target (t));
+ target_close (t);
+ }
}
/* See target.h. */
strata stratum = t->stratum ();
+ if (stratum == process_stratum)
+ connection_list_add (as_process_stratum_target (t));
+
/* If there's already a target at this stratum, remove it. */
if (m_stack[stratum] != NULL)