简体   繁体   English

跟踪加载ELF文件

[英]Tracing loading of ELF file

Is it possible to trace loading of ELF executable from typing name of program and pressing enter until execution of main function? 是否可以通过键入程序名称并按Enter直到执行主要功能来跟踪ELF可执行文件的加载? If yes, then how to do this? 如果是,那么该怎么做?

man ld.so

会告诉您有关LD_DEBUG的信息。

How about strace? strace呢?

strace myprog myargs...

This will launch your program and print all the system calls as they are made, which I assume is what you meant by "trace." 这将启动您的程序并在进行所有系统调用时将其打印出来,我认为这就是您所说的“跟踪”。 You can just stop looking at the output once you see your own code being executed. 一旦看到自己的代码正在执行,您就可以停止查看输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM