Skip to content

Commit f735f33

Browse files
ndosscheLamentXU123
andcommitted
phpdbg: Fix wrong command names
Closes GH-24054. Co-authored-by: Weilin Du <weilindu@php.net>
1 parent 2842e1e commit f735f33

7 files changed

Lines changed: 24 additions & 5 deletions

File tree

‎NEWS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ PHP NEWS
3737
. Fixed bug GH-24218 (Invalid opcode for count() of a literal array when
3838
SCCP is disabled). (Lazizbek Ergashev)
3939

40+
- Phpdbg:
41+
. Fix wrong command names. (ndossche, Weilin Du)
42+
4043
- SOAP:
4144
. Fixed use of uninitialized func in do_request() on OOM bailout.
4245
(David Carlier)

‎sapi/phpdbg/phpdbg_break.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
2727

2828
#define PHPDBG_BREAK_COMMAND_D(f, h, a, m, l, s, flags) \
29-
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[9], flags)
29+
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[11], flags)
3030

3131
/**
3232
* Commands

‎sapi/phpdbg/phpdbg_info.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
2727

2828
#define PHPDBG_INFO_COMMAND_D(f, h, a, m, l, s, flags) \
29-
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[13], flags)
29+
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[15], flags)
3030

3131
const phpdbg_command_t phpdbg_info_commands[] = {
3232
PHPDBG_INFO_COMMAND_D(break, "show breakpoints", 'b', info_break, NULL, 0, PHPDBG_ASYNC_SAFE),

‎sapi/phpdbg/phpdbg_list.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
3535

3636
#define PHPDBG_LIST_COMMAND_D(f, h, a, m, l, s, flags) \
37-
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[12], flags)
37+
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[14], flags)
3838

3939
const phpdbg_command_t phpdbg_list_commands[] = {
4040
PHPDBG_LIST_COMMAND_D(lines, "lists the specified lines", 'l', list_lines, NULL, "l", PHPDBG_ASYNC_SAFE),

‎sapi/phpdbg/phpdbg_print.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
2727

2828
#define PHPDBG_PRINT_COMMAND_D(f, h, a, m, l, s, flags) \
29-
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[8], flags)
29+
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[10], flags)
3030

3131
const phpdbg_command_t phpdbg_print_commands[] = {
3232
PHPDBG_PRINT_COMMAND_D(exec, "print out the instructions in the main execution context", 'e', print_exec, NULL, 0, PHPDBG_ASYNC_SAFE),

‎sapi/phpdbg/phpdbg_set.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
2727

2828
#define PHPDBG_SET_COMMAND_D(f, h, a, m, l, s, flags) \
29-
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[17], flags)
29+
PHPDBG_COMMAND_D_EXP(f, h, a, m, l, s, &phpdbg_prompt_commands[19], flags)
3030

3131
const phpdbg_command_t phpdbg_set_commands[] = {
3232
PHPDBG_SET_COMMAND_D(prompt, "usage: set prompt [<string>]", 'p', set_prompt, NULL, "|s", 0),
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
Subcommand error messages name the correct parent command
3+
--PHPDBG--
4+
list lines
5+
print func
6+
break at
7+
info literal 1
8+
set prompt 1
9+
q
10+
--EXPECT--
11+
prompt> [The command "list lines" expected at least 1 arguments (l) and received 0]
12+
prompt> [The command "print func" expected string and got nothing at parameter 1]
13+
prompt> [The command "break at" expected at least 2 arguments (*c) and received 0]
14+
prompt> [The command "info literal" expected no arguments]
15+
prompt> [The command "set prompt" expected string and got numeric at parameter 1]
16+
prompt>

0 commit comments

Comments
 (0)