Is there any way to tell gdb to wait for a process to start and attach to it?

后端 未结 6 1765
独厮守ぢ
独厮守ぢ 2020-12-24 01:44

I have a process that is called by another process which is called by another process and so on ad nauseum. It\'s a child process in a long tool chain.

This process

6条回答
  •  臣服心动
    2020-12-24 02:16

    Not exactly what you expect, but it might help you in debugging.

    valgrind --trace-children=yes your_program
    

    will check and print memory errors in all children of the process, with stack trace and some detail about the error (eg. in case of double-free, you'd get the stack trace of the first free).

    Also, you might make the crashing process generate a core dump, and debug this post-mortem. See this answer for details.

提交回复
热议问题