Skip to content

PHPDBG: fix bug parsing 3-word opcodes #6895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

davidrans
Copy link
Contributor

PHPDBG wasn't parsing opcodes correctly if they were more than two words
separated by underscores (as many opcodes, like ZEND_POST_INC, are).

This adds a regression test. The output of that test prior to this fix was:

[Successful compilation of %s]
prompt> [Breakpoint #0 added at ZEND_POST_INC]
prompt> 1234
[Script ended normally]
prompt> [Not running]
prompt> [Not running]
prompt> [Not running]
prompt> [Not running]
prompt>

From that output you can see that the ZEND_POST_INC opcode was not being parsed correctly, cause no breakpoints were being hit.

PHPDBG won't parse opcodes correctly if they are more than two words
separated by underscores (as many opcodes, like ZEND_POST_INC, are).

"Actual" output from this failing test is:
```
[Successful compilation of %s]
prompt> [Breakpoint #0 added at ZEND_POST_INC]
prompt> 1234
[Script ended normally]
prompt> [Not running]
prompt> [Not running]
prompt> [Not running]
prompt> [Not running]
prompt>
```
Now opcodes that have more than one underscore (e.g. ZEND_POST_INC) are
parsed correctly.

This change gets the test added in the previous commit
(sapi/phpdbg/tests/breakpoints_009.phpt) passing.
@nikic nikic closed this in 054fad6 Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants