Systemtap 如何对lua、php进行用户态追踪

118 views
Skip to first unread message

op1125...@gmail.com

unread,
Dec 2, 2018, 9:19:01 PM12/2/18
to openresty
我完成了对C++的用户态追踪,这是因为C++生成的可执行文件包含调试信息。但是lua和php我都没做到,有大佬知道该怎么做吗?

op1125...@gmail.com

unread,
Dec 14, 2018, 5:41:02 AM12/14/18
to openresty


在 2018年12月3日星期一 UTC+8上午10:19:01,op1125...@gmail.com写道:
我完成了对C++的用户态追踪,这是因为C++生成的可执行文件包含调试信息。但是lua和php我都没做到,有大佬知道该怎么做吗?

葛 云飞

unread,
Dec 14, 2018, 7:11:07 AM12/14/18
to open...@googlegroups.com

 

Lua 本身就是动态语言,你还需要什么调试信息啊?

可以用 debug库的 sethook 试试

发件人: "open...@googlegroups.com" <open...@googlegroups.com> 代表 "op1125...@gmail.com" <op1125...@gmail.com>
答复: "open...@googlegroups.com" <open...@googlegroups.com>
日期: 20181214 星期五 下午6:41
收件人: openresty <open...@googlegroups.com>
主题: [openresty] Re: Systemtap 如何对luaphp进行用户态追踪

 



2018123日星期一 UTC+8上午10:19:01op1125...@gmail.com写道:

我完成了对C++的用户态追踪,这是因为C++生成的可执行文件包含调试信息。但是luaphp我都没做到,有大佬知道该怎么做吗?

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

op1125...@gmail.com

unread,
Dec 17, 2018, 6:38:47 AM12/17/18
to openresty
比如可以打印lua脚本中某个函数的参数的值:
像这样的脚本:
function max(num1, num2)
   if (num1 > num2) then
      result = num1;
   else
      result = num2;
   end
   return result; 
end
print("两值比较最大值为 ",max(1,2))


在Systmtap中打印进入函数max时的参数的值(也就是1和2)


在 2018年12月14日星期五 UTC+8下午8:11:07,老拐瘦&拐爷写道:
Reply all
Reply to author
Forward
0 new messages