From 2978f35a9a35b6aa041f38a2f1465486b8592a4d Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Thu, 1 Oct 2026 21:01:53 +0200 Subject: [PATCH 1/3] phpdbg: Fix wrong command names --- sapi/phpdbg/phpdbg_break.c | 2 +- sapi/phpdbg/phpdbg_info.c | 2 +- sapi/phpdbg/phpdbg_list.c | 2 +- sapi/phpdbg/phpdbg_print.c | 2 +- sapi/phpdbg/tests/subcommand_parent_name.phpt | 14 ++++++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 sapi/phpdbg/tests/subcommand_parent_name.phpt diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c index 481e4b8693be..95f25c438632 100644 --- a/sapi/phpdbg/phpdbg_break.c +++ b/sapi/phpdbg/phpdbg_break.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_BREAK_COMMAND_D(f, h, a, m, l, s, flags) \ - PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[9], flags) + PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[11], flags) /** * Commands diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index d64703755cbe..833240d3bfcd 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_INFO_COMMAND_D(f, h, a, m, l, s, flags) \ - PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[13], flags) + PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[15], flags) const phpdbg_command_t phpdbg_info_commands[] = { PHPDBG_INFO_COMMAND_D(break, "show breakpoints", 'b', info_break, NULL, 0, PHPDBG_ASYNC_SAFE), diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c index 00ef995d897e..415dc294c9ad 100644 --- a/sapi/phpdbg/phpdbg_list.c +++ b/sapi/phpdbg/phpdbg_list.c @@ -34,7 +34,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_LIST_COMMAND_D(f, h, a, m, l, s, flags) \ - PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[12], flags) + PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[14], flags) const phpdbg_command_t phpdbg_list_commands[] = { PHPDBG_LIST_COMMAND_D(lines, "lists the specified lines", 'l', list_lines, NULL, "l", PHPDBG_ASYNC_SAFE), diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c index b0f8d4cb2940..9938ba006574 100644 --- a/sapi/phpdbg/phpdbg_print.c +++ b/sapi/phpdbg/phpdbg_print.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_PRINT_COMMAND_D(f, h, a, m, l, s, flags) \ - PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[8], flags) + PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[10], flags) const phpdbg_command_t phpdbg_print_commands[] = { PHPDBG_PRINT_COMMAND_D(exec, "print out the instructions in the main execution context", 'e', print_exec, NULL, 0, PHPDBG_ASYNC_SAFE), diff --git a/sapi/phpdbg/tests/subcommand_parent_name.phpt b/sapi/phpdbg/tests/subcommand_parent_name.phpt new file mode 100644 index 000000000000..fdf1862a90b4 --- /dev/null +++ b/sapi/phpdbg/tests/subcommand_parent_name.phpt @@ -0,0 +1,14 @@ +--TEST-- +Subcommand error messages name the correct parent command +--PHPDBG-- +list lines +print func +break at +info literal 1 +q +--EXPECT-- +prompt> [The command "list lines" expected at least 1 arguments (l) and received 0] +prompt> [The command "print func" expected string and got nothing at parameter 1] +prompt> [The command "break at" expected at least 2 arguments (*c) and received 0] +prompt> [The command "info literal" expected no arguments] +prompt> From 4f649eeeec47412d0ebe97c286e52d8fa09df5ae Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 10 Oct 2026 14:01:35 +0200 Subject: [PATCH 2/3] Fix another case --- sapi/phpdbg/phpdbg_set.c | 2 +- sapi/phpdbg/tests/subcommand_parent_name.phpt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c index d6b19a7e551a..d6b747e366d2 100644 --- a/sapi/phpdbg/phpdbg_set.c +++ b/sapi/phpdbg/phpdbg_set.c @@ -26,7 +26,7 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg) #define PHPDBG_SET_COMMAND_D(f, h, a, m, l, s, flags) \ - PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[17], flags) + PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[19], flags) const phpdbg_command_t phpdbg_set_commands[] = { PHPDBG_SET_COMMAND_D(prompt, "usage: set prompt []", 'p', set_prompt, NULL, "|s", 0), diff --git a/sapi/phpdbg/tests/subcommand_parent_name.phpt b/sapi/phpdbg/tests/subcommand_parent_name.phpt index fdf1862a90b4..46fe0385f379 100644 --- a/sapi/phpdbg/tests/subcommand_parent_name.phpt +++ b/sapi/phpdbg/tests/subcommand_parent_name.phpt @@ -5,10 +5,12 @@ list lines print func break at info literal 1 +set color q --EXPECT-- prompt> [The command "list lines" expected at least 1 arguments (l) and received 0] prompt> [The command "print func" expected string and got nothing at parameter 1] prompt> [The command "break at" expected at least 2 arguments (*c) and received 0] prompt> [The command "info literal" expected no arguments] +prompt> [The command "set color" expected string and got nothing at parameter 1] prompt> From e070bd9fe1b73d0a5a16e523aec207883d67d533 Mon Sep 17 00:00:00 2001 From: ndossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 10 Oct 2026 15:33:51 +0200 Subject: [PATCH 3/3] Fix slopdows Co-authored-by: Weilin Du --- sapi/phpdbg/tests/subcommand_parent_name.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/phpdbg/tests/subcommand_parent_name.phpt b/sapi/phpdbg/tests/subcommand_parent_name.phpt index 46fe0385f379..f1ac34fcc06b 100644 --- a/sapi/phpdbg/tests/subcommand_parent_name.phpt +++ b/sapi/phpdbg/tests/subcommand_parent_name.phpt @@ -5,12 +5,12 @@ list lines print func break at info literal 1 -set color +set prompt 1 q --EXPECT-- prompt> [The command "list lines" expected at least 1 arguments (l) and received 0] prompt> [The command "print func" expected string and got nothing at parameter 1] prompt> [The command "break at" expected at least 2 arguments (*c) and received 0] prompt> [The command "info literal" expected no arguments] -prompt> [The command "set color" expected string and got nothing at parameter 1] +prompt> [The command "set prompt" expected string and got numeric at parameter 1] prompt>