問題是ltrace
只攔截來自主可執行文件(此處爲abiword
)的調用到其他共享庫,但不攔截從一個共享庫到另一個共享庫的調用。
爲abiword
,則main
功能實際上並沒有做太多:
(gdb) disas main
Dump of assembler code for function main:
0x0000000000400a70 <+0>: mov %rsi,%rdx
0x0000000000400a73 <+3>: mov %edi,%esi
0x0000000000400a75 <+5>: mov $0x400b6c,%edi
0x0000000000400a7a <+10>: jmpq 0x400950 <[email protected]>
End of assembler dump.
正如你所看到的,它只是做了return AP_UnixApp::main(argc, "abiword", argv);
,和所有的實際活動中實現AP_UnixApp::main
庫發生(在我情況,在/usr/lib/libabiword-2.8.so
)。
在Fedora系統上,您可以嘗試使用frysk
來代替。特別是這樣的:
ftrace -sym '*' abiword
產生(超長)跟蹤,開頭:
528.528 attached /usr/bin/abiword
528.528 call #libpthread.so.0#_init(0x1, 0x7fffa8ba5bd8, 0x7fffa8ba5be8, 0x7fffa8ba5be8, 0x1f25bc2, 0x7)
528.528 call #libpthread.so.0#__pthread_initialize_minimal(0x1, 0x7fffa8ba5bd8, 0x7fffa8ba5be8, 0x7fffa8ba5be8, 0x1f25bc2, 0x7)
528.528 call #libpthread.so.0#__libc_sigaction(0x20, 0x7fffa8ba5a70, 0x0, 0x0, 0x1f25bc2, 0x7)
528.528 call #libpthread.so.0#__libc_sigaction(0x21, 0x7fffa8ba5a70, 0x0, 0x7f32501f27b0, 0x0, 0x7)
528.528 call #libc.so.6#getrlimit(0x3, 0x7fffa8ba5b10, 0x3f, 0x40, 0x0, 0x7) = 0
528.528 call #libc.so.6#sysconf(0x1e, 0x7fffa8ba5b10, 0x3f, 0x30220e7b17, 0x0, 0x7)
528.528 call #libc.so.6#getpagesize(0x1e, 0x7fffa8ba5b10, 0xfffffffffff51435, 0x30220e7b17, 0x0, 0x7) = 4096
528.528 leave #libc.so.6#sysconf = 4096
528.528 call #libc.so.6#__libc_dl_error_tsd(0x1e, 0x7fffa8ba5b10, 0x800000, 0x2a40, 0x0, 0x7) = 139854069229848
...
Ftrace文檔here。