Hi, I noticed that issuing a next over a fork call, with "follow-fork-mode child", wasn't working. The problem is that when we update the breakpoints in the child to attach them to the current thread if their thread their currently attached to doesn't exist anymore, inferior_ptid doesn't hold the tid yet. static int linux_child_follow_fork (struct target_ops *ops, int follow_child) (...) inferior_ptid = ptid_build (child_pid, child_pid, 0); /* Reinstall ourselves, since we might have been removed in target_detach (which does other necessary cleanup). */ push_target (ops); linux_nat_switch_fork (inferior_ptid); check_for_thread_db (); /* Reset breakpoints in the child as appropriate. */ follow_inferior_reset_breakpoints (); <- this would fail } The patch attached updates fork-child-threads.exp with a test that would fail without the fix. No regressions on x86_64-unknown-linux-gnu. -- Pedro Alves