rfc:phpdbg
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:phpdbg [2013/11/21 10:15] – Fixed my name felipe | rfc:phpdbg [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Author: Joe Watkins < | * Author: Joe Watkins < | ||
* Author: Felipe Pena < | * Author: Felipe Pena < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This is a proposal to include | + | phpdbg |
- | ===== Proposal ===== | + | Like CLI, and gdb, phpdbg is an executable intended to be executed at the terminal in an interactive way. |
- | Felipe Pena and I have recently developed a debugging platform for PHP, development continues ... | + | Much power is provided to the user in order to control |
- | It could (should) be included in the distribution in the /sapi folder, it makes no changes to any other SAPI. | + | phpdbg> break [file] test.php:1 |
+ | phpdbg> b [F] test.php: | ||
+ | Will break execution on line 1 of test.php | ||
- | There will be a great benefit | + | phpdbg> break [func] my_function |
+ | phpdbg> b [f] my_function | ||
+ | Will break execution on entry to my_function | ||
- | Usually, the content of an RFC is used for the basis for documentation of a feature if it is merged; | + | phpdbg> break [method] \my\class:: |
+ | phpdbg> b [m] \my\class:: | ||
+ | Will break execution on entry to \my\class:: | ||
- | I ask in this case we make an exception, documenting the use of a debugger is a huge task, not suited for these pages. | + | phpdbg> break [address] 0x7ff68f570e08 |
- | We will of course write documentation, | + | phpdbg> b [a] 0x7ff68f570e08 |
+ | Will break at the opline with the address provided | ||
- | This is a brief proposal to get the conversation started, I am busy ... anything you might want to know about the software can be read in source or on the phpdbg website. | + | phpdbg> break [lineno] 200 |
+ | phpdbg> b [l] 200 | ||
+ | Will break at line 200 of the currently executing file | ||
- | http://phpdbg.com | + | phpdbg> break on ($expression == true) |
+ | phpdbg> b on ($expression == true) | ||
+ | Will break when the condition evaluates to true | ||
- | If anything requires clarification, | + | phpdbg> break at phpdbg:: |
+ | phpdbg> b at phpdbg:: | ||
+ | Will break in phpdbg:: | ||
+ | phpdbg> break op ZEND_ADD | ||
+ | phpdbg> b O ZEND_ADD | ||
+ | Will break on every occurence of the opcode provided | ||
+ | |||
+ | phpdbg> break del 1 | ||
+ | phpdbg> b d 1 | ||
+ | |||
+ | phpdbg has a step-through-each-opcode mode, whereby the interactive console is presented to the user after the execution of each individual opcode, and a few useful commands besides. | ||
+ | |||
+ | Disassembly of code is supported, providing tooling to inspect the internal structure of code in an effort to be a useful tool for pecl devs and php programmers. | ||
+ | |||
+ | phpdbg> print class phpdbg | ||
+ | [User Class: phpdbg] | ||
+ | Methods (1): | ||
+ | L9-13 phpdbg:: | ||
+ | L9 0x7f41937db810 ZEND_RECV_INIT | ||
+ | L11 | ||
+ | L11 | ||
+ | L11 | ||
+ | L11 | ||
+ | L12 | ||
+ | | ||
+ | phpdbg> info literal | ||
+ | [Literal Constants in / | ||
+ | |-------- C0 -------> [%s/ | ||
+ | |-------- C1 -------> [/ | ||
+ | |-------- C2 -------> [dirname] | ||
+ | |-------- C3 -------> [sprintf] | ||
+ | |-------- C4 -------> [php:// | ||
+ | |-------- C5 -------> [w+] | ||
+ | |-------- C6 -------> [fopen] | ||
+ | |-------- C9 -------> [phpdbg] | ||
+ | |-------- C10 -------> [phpdbg] | ||
+ | |-------- C11 -------> [isGreat] | ||
+ | |-------- C12 -------> [isGreat] | ||
+ | |-------- C13 -------> [isgreat] | ||
+ | |-------- C14 -------> [PHP Rocks !!] | ||
+ | |-------- C15 -------> [var_dump] | ||
+ | |-------- C16 -------> [1] | ||
+ | |-------- C17 -------> [test] | ||
+ | |-------- C18 -------> [1] | ||
+ | |-------- C19 -------> [it works! | ||
+ | ] | ||
+ | |-------- C20 -------> [_SERVER] | ||
+ | |-------- C21 -------> [var_dump] | ||
+ | |-------- C23 -------> [1] | ||
+ | |||
+ | Many more commands provide access to just about everything ... | ||
+ | | ||
+ | Remote Debugging: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Remote Debugging is supported in unix by way of a protocol-free inetd like service, the Java client displayed is distributed with phpdbg, and is at least as comfortable as the command line, more so for some perhaps. | ||
+ | |||
+ | Much more information and documentation can be found on http:// | ||
+ | ===== Proposal ===== | ||
+ | |||
+ | phpdbg could (should) be included in the distribution in the /sapi folder, it makes no changes to any other SAPI. | ||
+ | |||
+ | The reason it should be included is, as a SAPI module, it is quite difficult to distribute phpdbg to a large audience. | ||
+ | |||
+ | The debugging environment is self contained within that executable, without requiring changes to any other binaries or libraries, with no need to share configurations it's installation is non-intrusive. | ||
+ | |||
+ | phpdbg can be merged into 5.6+ as it has already been patched, 5.5 would require a small change ... that boat has probably sailed ... | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 37: | Line 117: | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | ASAP | + | 5.6 |
+ | |||
+ | Note: it would be nice if 5.5 could get phpdbg too, but requires a patch that might cause ABI incompatibiilty issues caused by new exports. | ||
===== SAPIs Impacted ===== | ===== SAPIs Impacted ===== | ||
Line 45: | Line 127: | ||
===== Impact to Existing Extensions ===== | ===== Impact to Existing Extensions ===== | ||
- | None | + | Opcache requires the following patch to support phpdbg: http:// |
+ | |||
+ | Note: that list should be a blacklist, it's more forward compatible, the assumption that it doesn' | ||
+ | |||
+ | This limitation, which may have an affect on userland software where php_sapi_name() is used, can be mitigated using the -S option to override the SAPI name. | ||
+ | Note that, overriding the SAPI name only changes the name as reported to the rest of the engine; //it does not use any of the structures from the SAPI requested// | ||
===== New Constants ===== | ===== New Constants ===== | ||
Line 81: | Line 168: | ||
The phpdbg codebase is compatible with 5.4+ | The phpdbg codebase is compatible with 5.4+ | ||
+ | |||
+ | ===== Impact to phpdbg ===== | ||
+ | |||
+ | If phpdbg is bundled, it means that it must follow the release cycle of PHP itself; we're not sure if this will create any problem - every other SAPI manages it, and there' | ||
+ | |||
+ | This is definitely the way we will go, should the need arise, however, we would prefer not to have to disturb the build process or code base unnecessarily. | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
Line 98: | Line 191: | ||
N/A | N/A | ||
+ | |||
+ | ===== Vote ===== | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
+ | |||
+ | Voting commenced December 11th 2013, closing December 18th 2013. |
rfc/phpdbg.1385028945.txt.gz · Last modified: 2017/09/22 13:28 (external edit)