Я запускаю приложение (firefox), и я хотел бы знать, возможно ли использовать GDB для подключения к процессу и уничтожения определенного потока . Есть ли способ сделать это?
Я понимаю, что эта операция, вероятно, приведет к сбою приложения.
EDIT:
В этом сеансе отладки ps -ax
обнаружил, что pid firefox равен 1328:
$ gdb /Applications/Firefox.app/Contents/MacOS/firefox 1328
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ....... done
/Users/karlphillip/1328: No such file or directory
Attaching to program: `/Applications/Firefox.app/Contents/MacOS/firefox', process 1328.
Reading symbols for shared libraries + done
Reading symbols for shared libraries ++++++......................................................................................................................................................................................................... done
0x00007fff90b9a67a in mach_msg_trap ()
(gdb) info threads
25 0x00007fff90b9bbca in __psynch_cvwait ()
24 0x00007fff90b9bbca in __psynch_cvwait ()
23 0x00007fff90b9bbca in __psynch_cvwait ()
22 0x00007fff90b9a67a in mach_msg_trap ()
21 0x00007fff90b9bbca in __psynch_cvwait ()
20 0x00007fff90b9bbca in __psynch_cvwait ()
19 0x00007fff90b9bbca in __psynch_cvwait ()
18 0x00007fff90b9bbca in __psynch_cvwait ()
17 0x00007fff90b9bbca in __psynch_cvwait ()
16 0x00007fff90b9bbca in __psynch_cvwait ()
15 0x00007fff90b9bbca in __psynch_cvwait ()
14 0x00007fff90b9bbca in __psynch_cvwait ()
13 0x00007fff90b9bbca in __psynch_cvwait ()
12 0x00007fff90b9bbca in __psynch_cvwait ()
11 0x00007fff90b9bbca in __psynch_cvwait ()
10 0x00007fff90b9bbca in __psynch_cvwait ()
9 0x00007fff90b9bbca in __psynch_cvwait ()
8 0x00007fff90b9bbca in __psynch_cvwait ()
7 0x00007fff90b9bdf2 in select$DARWIN_EXTSN ()
6 0x00007fff90b9bbca in __psynch_cvwait ()
5 0x00007fff90b9bbca in __psynch_cvwait ()
4 0x00007fff90b9c7e6 in kevent ()
3 0x00007fff90b9a67a in mach_msg_trap ()
2 "com.apple.libdispatch-manager" 0x00007fff90b9c7e6 in kevent ()
* 1 "com.apple.main-thread" 0x00007fff90b9a67a in mach_msg_trap ()
(gdb) call raise(6, NOHUP)
No symbol table is loaded. Use the "file" command.
(gdb)