This patch makes sure that the thread/task we attach to with ptrace targets is added to GDB's thread table. Targets that extend inf-ptrace (inf_ptrace_target) should then use thread_change_ptid as soon as then have more lwp or tid info, instead of just setting inferior_ptid. Targets that don't have a process_stratum target overriding inf_ptrace_attach get it for free (BSD targets). This was tested together with the rest of the series on x86_64-unknown-linux-gnu, i386-unknown-openbsd4.3, i386-unknown-freebsd6.0 and i386-unknown-freebsd7.0. OK? -- Pedro Alves