Skip to content

phpdbg next command must step over function calls #6031

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
wants to merge 1 commit into from

Conversation

ebernhardson
Copy link

No description provided.

@ebernhardson
Copy link
Author

ebernhardson commented Aug 21, 2020

This was broken in cf35dae. The fix is to try to better target the fix applied in that patch to only instances where we have left the current context and entered the previous context.

It wasn't clear when exactly oplines should be printed. What I've done here is not print intermediate oplines while stepping over.
I think this should probably behave roughly as if a breakpoint was set on the next line and we continued execution, and not print intermediate oplines.

@cmb69
Copy link
Member

cmb69 commented Aug 21, 2020

Thanks for the PR!

Could you please open a new ticked on https://bugs.php.net for this? Mainly for reference; the entry in NEWS should be something like "Fixed bug #12345 (bug title). (developer)".

@ebernhardson
Copy link
Author

Filed as 80006, updated NEWS

@cmb69
Copy link
Member

cmb69 commented Aug 22, 2020

Thanks, @ebernhardson! However, it is not recommendable to modify NEWS (or UPGRADING for that matter) directly in the pull request, because there quickly can be merge conflicts. Instead the person who merges the PR eventually, should add suitable entries to these files.

Anyhow, @bwoebi, thoughts on this PR?

@nikic nikic requested a review from bwoebi August 24, 2020 08:24
/* perform seek operation */
if ((PHPDBG_G(flags) & PHPDBG_SEEK_MASK) && !(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {
/* current address */
zend_ulong address = (zend_ulong) execute_data->opline;

if (PHPDBG_G(seek_ex) != execute_data) {
if (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) {
if (PHPDBG_G(seek_ex)->prev_execute_data == execute_data && PHPDBG_G(flags) & PHPDBG_IS_STEPPING) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that needs to be phpdbg_user_execute_data(PHPDBG_G(seek_ex)->prev_execute_data)

Copy link
Author

@ebernhardson ebernhardson Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how to test this? I've tried swapping and this then fails the current test.and i'm not sure which new tests it would start passing.

Copy link
Member

@bwoebi bwoebi Aug 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this obviously fails when called on top of the stack (prev_execute_data is NULL then). My bad. Needs to be some check PHPDBG_G(seek_ex)->prev_execute_data && phpdbg_user_execute_data(PHPDBG_G(seek_ex)->prev_execute_data) == execute_data I suppose.

@bwoebi
Copy link
Member

bwoebi commented Aug 25, 2020

The intermediary opcodes handling doesn't seem correct though: see your changed test sapi/phpdbg/tests/next_001.phpt ; now you do not have an indication at all what opcode we're now at when hitting line 8.

@ebernhardson ebernhardson force-pushed the phpdbg-next-7.3 branch 3 times, most recently from 04811ed to e4a46fe Compare September 13, 2020 16:10
@ebernhardson
Copy link
Author

Thanks for the review, updated patch should address all comments re: NEWS, phpdbg_user_execute_data, and intermediate opcode reporting

@ebernhardson
Copy link
Author

I took a look over the CI failures but it's not clear they are related to the patch. I've tried to reproduce but not having any luck localy. Any suggestions?

@cmb69
Copy link
Member

cmb69 commented Sep 14, 2020

The CI failures are unrelated to this PR; they are caused by 2d4aa1e.

@ramsey ramsey added the Bug label Jun 9, 2021
@cmb69
Copy link
Member

cmb69 commented Jul 29, 2021

@bwoebi or maybe @krakjoe, could you please review?

@ebernhardson, the patch can no longer target PHP-7.3, since this is in security mode. Please rebase onto PHP-7.4 or maybe a later version.

This was broken in cf35dae. The fix is to try to better target the fix
applied in that patch to only instances where we have left the current
context and entered the previous context.
@ebernhardson ebernhardson changed the base branch from PHP-7.3 to PHP-7.4 August 2, 2021 19:51
@ebernhardson
Copy link
Author

Patch updated to base against PHP-7.4 branch.

@cmb69
Copy link
Member

cmb69 commented Dec 2, 2021

And now PHP-7.4 won't receive any regular bugfixes anymore. Could you please rebase again? And maybe write to the internals mailing list to get more attention?

@github-actions
Copy link

github-actions bot commented Feb 8, 2022

There has not been any recent activity in this PR. It will automatically be closed in 7 days if no further action is taken.

@github-actions github-actions bot added the Stale label Feb 8, 2022
devnexen added a commit to devnexen/php-src that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants