Skip to content

Commit 1f9bba6

Browse files
committed
Make opcode breakpoints work again
1 parent e3cd070 commit 1f9bba6

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

sapi/phpdbg/phpdbg_bp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,9 @@ static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opline(phpdbg_opline_pt
928928

929929
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_opcode(zend_uchar opcode) /* {{{ */
930930
{
931-
const char *opname = phpdbg_decode_opcode(opcode);
931+
const char *opname = zend_get_opcode_name(opcode);
932932

933-
if (memcmp(opname, PHPDBG_STRL("UNKNOWN")) == 0) {
933+
if (!opname) {
934934
return NULL;
935935
}
936936

sapi/phpdbg/phpdbg_opcode.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727

2828
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
2929

30+
static inline const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
31+
{
32+
const char *ret = zend_get_opcode_name(opcode);
33+
if (ret) {
34+
return ret + 5; /* Skip ZEND_ prefix */
35+
}
36+
return "UNKNOWN";
37+
} /* }}} */
38+
3039
static inline char *phpdbg_decode_op(zend_op_array *ops, znode_op *op, uint32_t type) /* {{{ */
3140
{
3241
char *decode = NULL;
@@ -204,12 +213,3 @@ void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags
204213
{
205214
phpdbg_print_opline_ex(execute_data, ignore_flags);
206215
} /* }}} */
207-
208-
const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
209-
{
210-
const char *ret = zend_get_opcode_name(opcode);
211-
if (ret) {
212-
return ret + 5; /* Skip ZEND_ prefix */
213-
}
214-
return "UNKNOWN";
215-
} /* }}} */

sapi/phpdbg/phpdbg_opcode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#include "zend_types.h"
2525

26-
const char *phpdbg_decode_opcode(zend_uchar);
2726
char *phpdbg_decode_opline(zend_op_array *ops, zend_op *op);
2827
void phpdbg_print_opline(zend_execute_data *execute_data, zend_bool ignore_flags);
2928
void phpdbg_print_opline_ex(zend_execute_data *execute_data, zend_bool ignore_flags);

0 commit comments

Comments
 (0)