How can I switch between different processes fork() ed in gdb?

后端 未结 2 1178
不思量自难忘°
不思量自难忘° 2021-02-04 13:15

I\'m debugging such a multiple process application,

how can I switch between the fork()ed processes?

2条回答
  •  温柔的废话
    2021-02-04 13:35

    Show all the processes.

    (gdb) info inferiors 
      Num  Description       Executable        
      1    process 1000      /tmp/a.out 
    * 2                /tmp/a.out  # current attach inferior
    

    Switch between different processes.

    (gdb) inferior 1
    [Switching to inferior 1 [process 1000] (/tmp/a.out)]
    [Switching to thread 1.1 (LWP 1000)]
    

提交回复
热议问题