如果子进程调用 vfork(2)、fork1(2) 或 fork(2) 函数,则进程 id 会发生更改,但进程映像保持不变。根据 dbx 环境变量 follow_fork_mode 的具体设置,dbx 会执行以下操作之一。
在传统行为中,dbx 将忽略派生而跟随父进程。
dbx 自动切换到使用新进程 ID 的派生子进程。到原始父进程的所有连接以及对该进程的所有认知均丢失。
此模式只有在通过 Sun Studio IDE 或 dbxtool 使用 dbx 时才有效。
只要 dbx 检测到派生,便会提示您选择 parent、child、both 或 stop to investigate。如果选择 stop,便可以检查程序的状态,然后键入 cont 继续执行;这时会再次提示选择继续的方式。仅在 Sun Studio IDE 和 dbxtool 中支持 both。