+ add_inferior_silent (corelow_pid);
+
+ /* Do this before acknowledging the inferior, so if
+ post_create_inferior throws (can happen easilly if you're loading
+ a core file with the wrong exec), we aren't left with threads
+ from the previous inferior. */
+ init_thread_list ();
+
+ /* Set INFERIOR_PTID early, so an upper layer can rely on it being
+ set while in the target_find_new_threads call below. */
+ inferior_ptid = pid_to_ptid (corelow_pid);
+
+ /* Assume ST --- Add a main task. We'll later detect when we go
+ from ST to MT. */
+ add_thread_silent (inferior_ptid);
+
+ /* This is done first, before anything has a chance to query the
+ inferior for information such as symbols. */
+ post_create_inferior (&core_ops, from_tty);
+
+ /* Build up thread list from BFD sections, and possibly set the
+ current thread to the .reg/NN section matching the .reg
+ section. */
+ bfd_map_over_sections (core_bfd, add_to_thread_list,
+ bfd_get_section_by_name (core_bfd, ".reg"));
+
+ /* Now go through the target stack looking for threads since there
+ may be a thread_stratum target loaded on top of target core by
+ now. The layer above should claim threads found in the BFD
+ sections. */
+ target_find_new_threads ();
+