c++ - 如何查看php内核的调度顺序,不想每次编译然后看看是否执行了自己想要的分支
问题是这样的,我想调试一下看看php内核的具体文件调用,大体的调用结构自己大概也知道了,但是具体的不知道如何方便的调试
我目前所用的方法就是手动的去php_printf一些信息,然后重新编译php来看看是否走到了这一步,但是这样每次花好长时间重新编译。
所以想问大家有没有好的办法可以调试!
回复内容:
问题是这样的,我想调试一下看看php内核的具体文件调用,大体的调用结构自己大概也知道了,但是具体的不知道如何方便的调试
我目前所用的方法就是手动的去php_printf一些信息,然后重新编译php来看看是否走到了这一步,但是这样每次花好长时间重新编译。
所以想问大家有没有好的办法可以调试!
strace
编译 php
时 configure
中添加 --enable-debug
即可打开 php
调试模式,这时候编译的 php
是带有调试信息的,可以通过 gdb
进行断点调试。不知道这样能不能满足你的需求?
不知道你使用的是什么IDE,我只是介绍一下我的经验。我开发PHP扩展使用 CLion
,使用 debug 模式的 php ,在 Clion 中直接使用 gcc 编译扩展运行,断点可以直接在编译器中打,调试运行、步进都正常使用。如果 php 的源码仍然保留着,可以把断点直接打到源码中。编译到开始调试一步完成。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The future of PHP will be achieved by adapting to new technology trends and introducing innovative features: 1) Adapting to cloud computing, containerization and microservice architectures, supporting Docker and Kubernetes; 2) introducing JIT compilers and enumeration types to improve performance and data processing efficiency; 3) Continuously optimize performance and promote best practices.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP remains important in modern web development, especially in content management and e-commerce platforms. 1) PHP has a rich ecosystem and strong framework support, such as Laravel and Symfony. 2) Performance optimization can be achieved through OPcache and Nginx. 3) PHP8.0 introduces JIT compiler to improve performance. 4) Cloud-native applications are deployed through Docker and Kubernetes to improve flexibility and scalability.

The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

Python is suitable for data science, web development and automation tasks, while C is suitable for system programming, game development and embedded systems. Python is known for its simplicity and powerful ecosystem, while C is known for its high performance and underlying control capabilities.

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

MySQL download prompts a disk write error. The solution is as follows: 1. Check whether the disk space is insufficient, clean up the space or replace a larger disk; 2. Use disk detection tools (such as chkdsk or fsck) to check and fix disk errors, and replace the hard disk if necessary; 3. Check the target directory permissions to ensure that the user account has write permissions; 4. Change the download tool or network environment, and use the download manager to restore interrupted download; 5. Temporarily close the anti-virus software or firewall, and re-enable it after the download is completed. By systematically troubleshooting these aspects, the problem can be solved.
