How to attach to child process in LLDB

别说谁变了你拦得住时间么 提交于 2019-11-29 02:18:56

问题


My process starts child processes and I want to debug these as well, using LLDB on OS X. I can't find any option in the debugger to auto-attach. How to do it?


回答1:


Google is really silent on this issue, but I found a workaround.

Run your main process and stop it before it spins off any children. Then put a breakpoint on the function fork:

b fork

and let the program continue. When it is about to launch a child process, the breakpoint will be hit. At this moment, run another instance of LLDB and let it wait and autoattach to your process:

attach -w -n yourapp

Now let the parent program continue.




回答2:


https://bugs.llvm.org/show_bug.cgi?id=17972 seems to be a relevant LLDB issue.



来源:https://stackoverflow.com/questions/14746315/how-to-attach-to-child-process-in-lldb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!