標籤:des style http color os io for 2014
在Eclipse裡調試c程式, 出現: "Error while launching command: gdb -version"。需要讓Eclipse知道Eclipse具體在什麼地方,配置方法是: "Debug configuration"-->"Debugger"-->"GDB debugger"裡的"gdb"改成gdb的絕對路徑:"/usr/local/bin/gdb"
但配置之後仍然會有錯誤:
Unable to find Mach task port for process-id 83686: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8))Unable to find Mach task port for process-id 83686: (os/kern) failure (0x5). (please check gdb is codesigned - see taskgated(8))
原因是在Mac系統(10.9)裡預設不允許GNU gdb訪問其他進程,需要對gdb進行簽名:
? ~ which gdb/usr/local/bin/gdb--> ~ codesign -s gdb-cert /usr/local/bin/gdb
簽名的命令是`codesign`,gdb-cert是自己製作的認證,後面跟上被簽名的進程: `/usr/local/bin/gdb`
下面是簽名的方法,參考資料來自:<BuildingOnDarwin><Installing GDB on OS X Mavericks>
鑰匙串訪問-->認證助理-->建立認證,在“認證助理”建立名字為gdb-cert的認證:
一路`繼續`,中間有個選項要選擇:
最終產生:
產生之後,用`codesign`註冊,重啟taskgated進程即可
? ~ ps -e | grep taskgated 69 ?? 2:06.20 /usr/libexec/taskgated -s84711 ttys002 0:00.00 grep --color=auto taskgated--> ~ sudo kill -9 69