29.3. ltrace - A library call tracer

简介:

ltrace ls

		
neo@netkiller:~/workspace/Document$ ltrace ls
__libc_start_main(0x407bb0, 1, 0x7fff827aea38, 0x413730, 0x413720 <unfinished ...>
strrchr("ls", '/')                                                                                            = NULL
setlocale(6, "")                                                                                              = "en_US.UTF-8"
bindtextdomain("coreutils", "/usr/share/locale")                                                              = "/usr/share/locale"
textdomain("coreutils")                                                                                       = "coreutils"
__cxa_atexit(0x40abb0, 0, 0, 0x736c6974756572, 1)                                                             = 0
isatty(1)                                                                                                     = 1
getenv("QUOTING_STYLE")                                                                                       = NULL
getenv("LS_BLOCK_SIZE")                                                                                       = NULL
getenv("BLOCK_SIZE")                                                                                          = NULL
getenv("BLOCKSIZE")                                                                                           = NULL
getenv("POSIXLY_CORRECT")                                                                                     = NULL
getenv("BLOCK_SIZE")                                                                                          = NULL
getenv("COLUMNS")                                                                                             = NULL
ioctl(1, 21523, 0x7fff827ae910)                                                                               = 0
getenv("TABSIZE")                                                                                             = NULL
getopt_long(1, 0x7fff827aea38, "abcdfghiklmnopqrstuvw:xABCDFGHI:"..., 0x00416a60, -1)                         = -1
__errno_location()                                                                                            = 0x7f89323f16a8
malloc(40)                                                                                                    = 0x02543870
memcpy(0x02543870, "", 40)                                                                                    = 0x02543870
__errno_location()                                                                                            = 0x7f89323f16a8
malloc(40)                                                                                                    = 0x025438a0
memcpy(0x025438a0, "", 40)                                                                                    = 0x025438a0
malloc(18400)                                                                                                 = 0x025438d0
malloc(32)                                                                                                    = 0x025434c0
strlen(".")                                                                                                   = 1
malloc(2)                                                                                                     = 0x025480c0
memcpy(0x025480c0, ".", 2)                                                                                    = 0x025480c0
__errno_location()                                                                                            = 0x7f89323f16a8
opendir(".")                                                                                                  = 0x025480e0
readdir(0x025480e0)                                                                                           = 0x02548108
readdir(0x025480e0)                                                                                           = 0x02548120
readdir(0x025480e0)                                                                                           = 0x02548138
readdir(0x025480e0)                                                                                           = 0x02548150
strlen("Tex")                                                                                                 = 3
malloc(4)                                                                                                     = 0x02550110
memcpy(0x02550110, "Tex", 4)                                                                                  = 0x02550110
readdir(0x025480e0)                                                                                           = 0x02548168
readdir(0x025480e0)                                                                                           = 0x02548188
strlen("makedoc")                                                                                             = 7
malloc(8)                                                                                                     = 0x02550130
memcpy(0x02550130, "makedoc", 8)                                                                              = 0x02550130
readdir(0x025480e0)                                                                                           = 0x025481a8
readdir(0x025480e0)                                                                                           = 0x025481c8
strlen("Docbook")                                                                                             = 7
malloc(8)                                                                                                     = 0x02550150
memcpy(0x02550150, "Docbook", 8)                                                                              = 0x02550150
readdir(0x025480e0)                                                                                           = NULL
closedir(0x025480e0)                                                                                          = 0
free(NULL)                                                                                                    = <void>
malloc(72)                                                                                                    = 0x025480e0
_setjmp(0x61c040, 0x25480e0, 0x2543af8, 3, 1)                                                                 = 0
__errno_location()                                                                                            = 0x7f89323f16a8
strcoll("makedoc", "Docbook")                                                                                 = 9
__errno_location()                                                                                            = 0x7f89323f16a8
strcoll("Tex", "Docbook")                                                                                     = 16
__errno_location()                                                                                            = 0x7f89323f16a8
strcoll("Tex", "makedoc")                                                                                     = 7
memcpy(0x025480f0, "\3208T\002", 8)                                                                           = 0x025480f0
realloc(NULL, 144)                                                                                            = 0x02548130
malloc(168)                                                                                                   = 0x025481d0
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550150, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550150, 0x7fff827ac0e0, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550130, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550130, 0x7fff827ac0e0, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550110, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac0e0, 8192, 0x2550110, 0x7fff827ac0e0, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550150, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550150, 0x7fff827ac110, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550150, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550150, 0x7fff827ac050, 0)                                    = 6
fwrite_unlocked("Docbook", 1, 7, 0x7f8931bab780)                                                              = 7
__overflow(0x7f8931bab780, 32, 0, 8, 0xffffffff)                                                              = 32
__overflow(0x7f8931bab780, 32, 1, 8, 0xffffffff)                                                              = 32
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550130, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550130, 0x7fff827ac110, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550130, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550130, 0x7fff827ac050, 0)                                    = 6
fwrite_unlocked("makedoc", 1, 7, 0x7f8931bab780)                                                              = 7
__overflow(0x7f8931bab780, 32, 1, 8, 7)                                                                       = 32
__overflow(0x7f8931bab780, 32, 2, 8, 7)                                                                       = 32
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550110, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac110, 8192, 0x2550110, 0x7fff827ac110, 0)                                    = 6
__errno_location()                                                                                            = 0x7f89323f16a8
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550110, -1, 0)                                                = 6
__ctype_get_mb_cur_max(0x7fff827ac050, 8192, 0x2550110, 0x7fff827ac050, 0)                                    = 6
fwrite_unlocked("Tex", 1, 3, 0x7f8931bab780)                                                                  = 3
__overflow(0x7f8931bab780, 10, 0, 120, 3Docbook  makedoc  Tex
)                                                                     = 10
free(0x025480c0)                                                                                              = <void>
free(NULL)                                                                                                    = <void>
free(0x025434c0)                                                                                              = <void>
exit(0 <unfinished ...>
__fpending(0x7f8931bab780, 0, 0x7f8931bac330, 0x7f8931bac330, 0x25434b0)                                      = 0
fclose(0x7f8931bab780)                                                                                        = 0
__fpending(0x7f8931bab860, 0, 0x7f8931bacdf0, 0, 0x7f89323f17a0)                                              = 0
fclose(0x7f8931bab860)                                                                                        = 0
+++ exited (status 0) +++
		
		





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
Ubuntu Unix Linux
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
成功解决ERROR: Unable to find the development tool `cc` in your path; please make sure that you have the
|
Java Maven Android开发
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
成功解决FATAL ERROR in native method: JDWP on getting class status, jvmtiError=JVMTI_ERROR_WRONG_PHASE
|
数据安全/隐私保护
dpkg-buildpackage: error: debian/rules binary subprocess was killed by signal 2
dpkg-buildpackage: error: debian/rules binary subprocess was killed by signal 2
1062 0
|
存储 编译器 C++
[√]leak-tracer源码使用到的函数
[√]leak-tracer源码使用到的函数
72 0
|
Java Android开发
Failed to load JavaHL Library.These are the errors that were encountered:no msvcp100 in java.library
Failed to load JavaHL Library.These are the errors that were encountered:no msvcp100 in java.library
|
Java
【Java异常】ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit erro
【Java异常】ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JDWP exit erro
375 0
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
233 0
dyld Library not loaded Reason image not found 问题解决
添加第三方框架,然后启动app的时候会,提示dyld: Library not loaded: Reason: image not found 网上大部分的做法都是把Build Phases 里对应framework后边的选项修改成为Optional,但这个是治标不治本,还是没法解决问题
212 0
|
Perl
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
718 0
|
网络安全
Qt :qt.network.ssl: QSslSocket : cannot call unresolved function TLSv1_1_client
Qt :qt.network.ssl: QSslSocket : cannot call unresolved function TLSv1_1_client
247 0
Qt :qt.network.ssl: QSslSocket : cannot call unresolved function TLSv1_1_client