gdb break when entering child process

后端 未结 2 1505
太阳男子
太阳男子 2021-01-03 06:56

I\'m having a tough time figuring this one out; I have a program, iverilog that executes a system() call to invoke another program, ivl

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-03 07:49

    This answer provides one way to achieve what you want.

    In theory, set follow-fork-mode child should work.

    In practice, the iverilog is likely itself a shell script that runs (forks) multiple commands, so at every fork you will need to decide whether you want to continue debugging the parent or the child. One wrong decision and you've lost control of the process that will eventually execute your program. This very likely explains why it didn't work for you.

提交回复
热议问题