Skip to content

Fix bug #80006: fix next command on next line. #14795

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

Open
wants to merge 1 commit into
base: PHP-8.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ PHP NEWS
- PHPDBG:
. Fixed bug GH-14596 (crashes with ASAN and ZEND_RC_DEBUG=1).
(David Carlier)
. Fixed bug 80006 (next command on function calls). (ebernhardson)

- Shmop:
. Fixed bug GH-14537 (shmop Windows 11 crashes the process). (nielsdos)
Expand Down
4 changes: 3 additions & 1 deletion sapi/phpdbg/phpdbg_prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1728,7 +1728,9 @@ void phpdbg_execute_ex(zend_execute_data *execute_data) /* {{{ */
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 &&
phpdbg_user_execute_data(PHPDBG_G(seek_ex)->prev_execute_data) == execute_data &&
PHPDBG_G(flags) & PHPDBG_IS_STEPPING) {
goto stepping;
}
goto next;
Expand Down
26 changes: 26 additions & 0 deletions sapi/phpdbg/tests/bug80006.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
Test next command step over functionality
--PHPDBG--
b 7
r
n
q
--EXPECTF--
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:7]
prompt> [Breakpoint #0 at %s:7, hits: 1]
>00007: foo();
00008: echo 1;
00009:
prompt> 0>00008: echo 1;
00009:
prompt>
--FILE--
<?php

function foo() {
echo 0;
}

foo();
echo 1;
Loading