switch_to_thread (tp->ptid);
}
- printf_filtered (_("[Switching to thread %d (%s)] "),
- pid_to_thread_id (inferior_ptid),
+ printf_filtered (_("[Switching to thread %s (%s)] "),
+ print_thread_id (inferior_thread ()),
target_pid_to_str (inferior_ptid));
}
else
fprintf_filtered (file, _("Printing of inferior events is %s.\n"), value);
}
+/* Return a new value for the selected inferior's id. */
+
+static struct value *
+inferior_id_make_value (struct gdbarch *gdbarch, struct internalvar *var,
+ void *ignore)
+{
+ struct inferior *inf = current_inferior ();
+
+ return value_from_longest (builtin_type (gdbarch)->builtin_int, inf->num);
+}
+
+/* Implementation of `$_inferior' variable. */
+
+static const struct internalvar_funcs inferior_funcs =
+{
+ inferior_id_make_value,
+ NULL,
+ NULL
+};
+
\f
void
show_print_inferior_events,
&setprintlist, &showprintlist);
+ create_internalvar_type_lazy ("_inferior", &inferior_funcs, NULL);
}