有没有办法限制 xdebug 生成的跟踪深度?
这个问题确实说明了一切。
我试图找出为什么 php 应用程序行为不当,但是 xdebug 向我抛出的大量数据使我很难理解流程。
如果我可以设置跟踪的深度,以便跳过任何超过 x 层深度的调用,那么会更容易理解发生了什么。有什么想法可以让 xdebug 做到这一点,或者有我可以使用的替代工具吗?
The question says it all, really.
I am trying to figure out why a php app is misbehaving, but the sheer amount of data thrown at me by xdebug makes it hard to understand the flow.
If I could set the depth of the trace such that any call more than x levels deep was skipped, then it would be easier to understand what was happening. Any ideas how to make xdebug do this, or is there an alternative tool I can use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Xdebug 对文件的函数/执行跟踪当前不支持此功能,并且 Xdebug 的堆栈跟踪也始终显示整个堆栈,我刚刚向问题跟踪器添加了一个功能请求:http://bugs.xdebug.org/view.php?id=722
德里克
Xdebug's function/execution tracing to file does currently not support this, and Xdebug's stacktraces always also show the whole stack I've just added a feature request to the issue tracker for it: http://bugs.xdebug.org/view.php?id=722
Derick
您可以通过调用 functions
xdebug_start_trace()< 来告诉 Xdebug 在哪里启动和停止函数跟踪代码中的 /code> 和
xdebug_stop_trace()
。使用 Xdebug 2.4 或更高版本,您还可以通过调用 function 限制 Xdebug 仅跟踪某些函数的执行
xdebug_start_function_monitor(数组 $list_of_functions_to_monitor )
。该数组包含您要跟踪的函数列表。You can tell Xdebug where to start and stop the function tracing by calling functions
xdebug_start_trace()
andxdebug_stop_trace()
in the code.With Xdebug version 2.4 or higher, you can also limit Xdebug to only trace execution of some functions by calling function
xdebug_start_function_monitor( array $list_of_functions_to_monitor )
. The array contains the list of functions you want to trace.一个简单的技巧:
给定一个跟踪文件,file_name,您可以使用:
with n = 2L + 1 仅显示具有深度的函数调用L。
例如,
只会给您顶层调用。
A cheap trick:
Given a trace file, file_name you can use:
with n = 2L + 1 to only show function calls with a depth of L.
So for example
Will give you just the top level call.