Linux 防止 strace 缩写参数?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6672743/
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
Prevent strace from abbreviating arguments?
提问by Jay Conrod
I'm trying to use strace to find out what commands a program executes using execve
. Some of the arguments in these commands are quite long, and strace is abbreviating the arguments to execve
(I see "..." after about 30 characters), preventing me from getting any useful information. How can I get the full text of each argument?
我正在尝试使用 strace 找出程序使用execve
. 这些命令中的一些参数很长,并且 strace 将参数缩写为execve
(我在大约 30 个字符后看到“...”),使我无法获得任何有用的信息。我怎样才能得到每个论点的全文?
I've read the man page. The -v option prints the environment, which is useful, but the arguments are still truncated.
我已经阅读了手册页。-v 选项打印环境,这很有用,但参数仍被截断。
strace -f -e trace=execve -v -p 1234
I also tried passing verbose=all, but this just gives some extra information about SIGCHLD.
我也尝试传递verbose=all,但这只是提供了一些关于SIGCHLD 的额外信息。
strace -f -e verbose=all trace=execve -v -p 1234
采纳答案by Matthew Slattery
You want the -v -s strsize
option, which specifies the maximum length of a string to display (the default is 32).
您需要该选项,该选项指定要显示的字符串的最大长度(默认值为 32)。-v -s strsize