1

Appleが、シンボル/メソッドdictationEnabledを持つ@interfaceSODictationPreferencesを持つプライベートフレームワークDictationServices.frameworkを使用するとします。プログラムでそのメソッドにブレークポイントを設定するにはどうすればよいでしょうか(ObjectiveCを使用)。

4

2 に答える 2

0

おそらくptrace経由ですか?

 ptrace -- process tracing and debugging

概要#include#include

 int
 ptrace(int request, pid_t pid, caddr_t addr, int data);

説明ptrace()は、トレースおよびデバッグ機能を提供します。これにより、1つのプロセス(トレースプロセス)が別のプロセス(トレースされたプロセス)を制御できるようになります。

于 2012-08-18T21:41:41.937 に答える
0

プログラム以外でそれを行う方法は次のとおりです。

root:~/DictationServices.framework$ ps -Afw | grep Preferences
  501 44726 44621   0  7:46PM ??         0:02.60 /Applications/System Preferences.app/Contents/MacOS/System Preferences
// pid of /Applications/System Preferences.app == 44726 
(gdb) attach 44726 
Attaching to process 44726.
Reading symbols for shared libraries + done
Reading symbols for shared libraries +++.+.+.+.+++++++..+++++++ done
Reading symbols for shared libraries + done
0x00007fff8befe686 in mach_msg_trap ()
(gdb) b dictationEnabled
Breakpoint 3 at 0x10e57bc93
(gdb) c
Continuing.
Breakpoint 3, 0x000000010e57bc93 in -[SODictationPreferences dictationEnabled] ()
(gdb) 
于 2012-07-28T17:55:02.930 に答える