<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[[实践OK]macbook上的ldd的替代，mac下的strace命令,mac下的strace命令。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 26 Nov 2019 02:10:39 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	一、Linux下经常会用到ldd查看程序使用了哪些共享链接库，很方便的一个工具，在Mac OS X上没有这个命令，如果想在Mac OS X查看程序使用了哪些链接库可以用otool 来代替。<br/>otool -L&nbsp;&nbsp;`which nginx`<br/>/usr/local/bin/nginx:<br/>&nbsp;&nbsp;/usr/local/opt/pcre2/lib/libpcre2-8.0.dylib (compatibility version 12.0.0, current version 12.0.0)<br/>&nbsp;&nbsp;/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)<br/>&nbsp;&nbsp;/usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)<br/>&nbsp;&nbsp;/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)<br/>&nbsp;&nbsp;/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)<br/><br/>来自：<a href="http://t.zoukankan.com/amoy9812-p-12322060.html" target="_blank">http://t.zoukankan.com/amoy9812-p-12322060.html</a><br/><br/><br/><br/>二、Linux中的strace可以查看程序运行时的系统调用，有时对于调试程序很有帮助，Mac OS X中可用dtruss (需要root)替代<br/>sudo dtruss<br/><br/><br/>strace在linux下用来跟踪某个进程的系统调用<br/>在solaris下，对应的是dtrace<br/>在mac下，对应的命令是：dtruss<br/>sudo dtruss -p&nbsp;&nbsp;770<br/>dtrace: system integrity protection is on, some features will not be available<br/><br/>SYSCALL(args)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= return<br/>kevent(0x8, 0x0, 0x0)&nbsp;&nbsp;&nbsp;&nbsp; = 0 0<br/>kevent(0x8, 0x0, 0x0)&nbsp;&nbsp;&nbsp;&nbsp; = 0 0<br/><br/>链接如下：<br/>一）在Mac OS X查看程序使用了哪些链接库可以用otool 来代替：<br/>otool -L /usr/bin/vim<br/>/usr/bin/vim:<br/>&nbsp;&nbsp;/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)<br/>&nbsp;&nbsp;/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)<br/>&nbsp;&nbsp;/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)<br/><br/>来自：https://www.dazhuanlan.com/2019/10/10/5d9ecd060ead4/<br/><br/>二）<br/>  dtruss df -h       # run and examine &quot;df -h&quot;<br/><br/>       dtruss -p 1871     # examine PID 1871<br/><br/>       dtruss -n tar      # examine all processes called &quot;tar&quot;<br/><br/>       dtruss -f test.sh  # run test.sh and follow children<br/><br/>链接：https://blog.csdn.net/sanbingyutuoniao123/article/details/73955092<br/><br/>实践有些问题，如下：<br/>dtruss df -h<br/>dtrace: system integrity protection is on, some features will not be available<br/>dtrace: failed to initialize dtrace: DTrace requires additional privileges<br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]macbook上的ldd的替代，mac下的strace命令,mac下的strace命令。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>