Can GDB kill a specific thread?

房东的猫 提交于 2019-12-04 12:09:03

You can certainly send a specific thread a signal with GDB call raise(kernel-thread-id, signo) or call pthread_kill(pthread-thread-id, signo).

EDIT:

No symbol table is loaded. Use the "file" command.

My guess is that you did something like this:

gdb
...
(gdb) attach <pid>

On some platforms GDB can figure out which executable is running in a given process (e.g. from /proc/<pid>/exe on Linux). I am guessing that MacOS is not one of these platforms, and so you must tell GDB. Do this instead:

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