static void add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) { ptid_t ptid; int core_tid; int pid, lwpid; asection *reg_sect = (asection *) reg_sect_arg; if (strncmp (bfd_section_name (abfd, asect), ".reg/", 5) != 0) return; core_tid = atoi (bfd_section_name (abfd, asect) + 5); pid = bfd_core_file_pid (core_bfd); if (pid == 0) { core_has_fake_pid = 1; pid = CORELOW_PID; } lwpid = core_tid; if (current_inferior ()->pid == 0) inferior_appeared (current_inferior (), pid); ptid = ptid_build (pid, lwpid, 0); add_thread (ptid); /* Warning, Will Robinson, looking at BFD private data! */ if (reg_sect != NULL && asect->filepos == reg_sect->filepos) /* Did we find .reg? */ inferior_ptid = ptid; /* Yes, make it current. */ }
static void add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg) { ptid_t ptid; int core_tid; int pid, lwpid; asection *reg_sect = (asection *) reg_sect_arg; int fake_pid_p = 0; struct inferior *inf; if (!startswith (bfd_section_name (abfd, asect), ".reg/")) return; core_tid = atoi (bfd_section_name (abfd, asect) + 5); pid = bfd_core_file_pid (core_bfd); if (pid == 0) { fake_pid_p = 1; pid = CORELOW_PID; } lwpid = core_tid; inf = current_inferior (); if (inf->pid == 0) { inferior_appeared (inf, pid); inf->fake_pid_p = fake_pid_p; } ptid = ptid_build (pid, lwpid, 0); add_thread (ptid); /* Warning, Will Robinson, looking at BFD private data! */ if (reg_sect != NULL && asect->filepos == reg_sect->filepos) /* Did we find .reg? */ inferior_ptid = ptid; /* Yes, make it current. */ }