macos 等效于 mac os X 上的 strace -feopen <command>

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1925978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:37:17  来源:igfitidea点击:

Equivalent of strace -feopen < command > on mac os X

macososx-snow-leoparddtracestrace

提问by Setjmp

This is useful for debugging (hence programming related). On linux, we can use the command

这对于调试很有用(因此与编程相关)。在linux上,我们可以使用命令

strace -feopen python myfile.py

to figure out which python modules and shared objects are loaded. Is there an equivalent one-liner on macOS X?

找出加载了哪些 python 模块和共享对象。macOS X 上是否有等效的单线?

回答by ephemient

I suppose you meant strace -fetrace=open?

我想你的意思是strace -fetrace=open

dtruss -f -t open python myfile.py