php / php/php-src

[Feature] get where "exit" was called/shutdown started

未关闭
#17,505 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Feature Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

There currently is no simple way to figure out what/where exit was called.

Since PHP 8.4 PHP is a proper function, however it seems it's xdebug won't break on it, even if set (besides the fact, there's tons of bugs with IDEs/xdebug when breaking on built-in functions, e.g. defined()

Stepping through the code until exit; is reached isn't feasible in all cases (it happens in a long running process, this might take a day...)

It would be great if there were a magic constant similar to __COMPILER_HALT_OFFSET__ that is available in shutdown function callbacks, which includes the last executed file + line in the main thread before shutdown started. But that's just a simple first suggestion, I'm open to everything that makes identifying/debugging this easier.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

该 issue 未指定任何文件、测试或实现入口点。首先跟踪 PHP 解释器如何处理 exit 和 shutdown 函数回调,然后定义一种可行的方式来公开最后执行的文件和行号;完成的标准是行为已完成规范定义、实现,并由测试覆盖。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
developer-experience, devtools
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。