从strace log执行linux上的系统调用

时间:2015-06-04 01:27:02

标签: system-calls strace

是否可以从strace日志执行一系列系统调用。 如果是这样,怎么样? 这个人做我想做的事(我认为......):

recvmsg(3, 0x7ffffe502cf0, 0) = -1 EAGAIN (Resource temporarily unavailable)
write(4, "\1\0\0\0\0\0\0\0", 8) = 8
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, 0) = 1 ([{fd=4, revents=POLLIN}])
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, 0) = 1 ([{fd=4, revents=POLLIN}])
read(4, "\1\0\0\0\0\0\0\0", 16) = 8
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}], 2, 0) = 0 (Timeout)
read(4, 0x7ffffe502e70, 16) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=3, revents=POLLOUT}])
writev(3, [{"\22\0\7\0\32\0 \1H\1\0\0\6\0\0\0 \27\31\0\1\0\0\0\232>\205\2\31\0\v\0"..., 284}, {NULL, 0}, {"", 0}], 3) = 284
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\34\0\27E\32\0 \1H\1\0\0\233>\205\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 128
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\17\0\36E\32\0 \1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 224
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\222\0\37E\234\0\0\0FC \1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096}], msg_controllen=0, msg_flags=0}, 0) = 32
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\22\0$E\234\0\0\0+\2\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096}], msg_controllen=0, msg_flags=0}, 0) = 256

等...

1 个答案:

答案 0 :(得分:0)

没有。即使在详细模式下,字符串也是不完整的,除非它们非常短。地址指针无效。