summaryrefslogtreecommitdiff
path: root/sapi/phpdbg
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg')
-rw-r--r--sapi/phpdbg/phpdbg.c2
-rw-r--r--sapi/phpdbg/phpdbg_bp.c2
-rw-r--r--sapi/phpdbg/phpdbg_break.c2
-rw-r--r--sapi/phpdbg/phpdbg_cmd.c2
-rw-r--r--sapi/phpdbg/phpdbg_eol.c2
-rw-r--r--sapi/phpdbg/phpdbg_frame.c6
-rw-r--r--sapi/phpdbg/phpdbg_help.c6
-rw-r--r--sapi/phpdbg/phpdbg_info.c2
-rw-r--r--sapi/phpdbg/phpdbg_io.c2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.c2
-rw-r--r--sapi/phpdbg/phpdbg_lexer.l2
-rw-r--r--sapi/phpdbg/phpdbg_list.c14
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c19
-rw-r--r--sapi/phpdbg/phpdbg_out.c2
-rw-r--r--sapi/phpdbg/phpdbg_parser.c2
-rw-r--r--sapi/phpdbg/phpdbg_parser.y2
-rw-r--r--sapi/phpdbg/phpdbg_print.c8
-rw-r--r--sapi/phpdbg/phpdbg_prompt.c11
-rw-r--r--sapi/phpdbg/phpdbg_set.c2
-rw-r--r--sapi/phpdbg/phpdbg_sigio_win32.c2
-rw-r--r--sapi/phpdbg/phpdbg_sigsafe.c2
-rw-r--r--sapi/phpdbg/phpdbg_utils.c14
-rw-r--r--sapi/phpdbg/phpdbg_wait.c7
-rw-r--r--sapi/phpdbg/phpdbg_watch.c6
-rw-r--r--sapi/phpdbg/tests/exceptions_003.phpt2
-rw-r--r--sapi/phpdbg/tests/print_001.phpt2
-rw-r--r--sapi/phpdbg/tests/stepping_001.phpt2
27 files changed, 62 insertions, 65 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 9321eed2d3..68a164c499 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -53,7 +53,7 @@
#endif
#if defined(PHP_WIN32) && defined(ZTS)
-ZEND_TSRMLS_CACHE_DEFINE();
+ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_DECLARE_MODULE_GLOBALS(phpdbg);
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c
index 5436bda5db..4cb1dae42c 100644
--- a/sapi/phpdbg/phpdbg_bp.c
+++ b/sapi/phpdbg/phpdbg_bp.c
@@ -26,7 +26,7 @@
#include "phpdbg_opcode.h"
#include "zend_globals.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
/* {{{ private api functions */
static inline phpdbg_breakbase_t *phpdbg_find_breakpoint_file(zend_op_array*);
diff --git a/sapi/phpdbg/phpdbg_break.c b/sapi/phpdbg/phpdbg_break.c
index 72739c117c..0640d96fd8 100644
--- a/sapi/phpdbg/phpdbg_break.c
+++ b/sapi/phpdbg/phpdbg_break.c
@@ -26,7 +26,7 @@
#include "phpdbg_bp.h"
#include "phpdbg_prompt.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+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)
diff --git a/sapi/phpdbg/phpdbg_cmd.c b/sapi/phpdbg/phpdbg_cmd.c
index 3497274428..f89e58a13c 100644
--- a/sapi/phpdbg/phpdbg_cmd.c
+++ b/sapi/phpdbg/phpdbg_cmd.c
@@ -25,7 +25,7 @@
#include "phpdbg_prompt.h"
#include "phpdbg_io.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
static inline const char *phpdbg_command_name(const phpdbg_command_t *command, char *buffer) {
size_t pos = 0;
diff --git a/sapi/phpdbg/phpdbg_eol.c b/sapi/phpdbg/phpdbg_eol.c
index 161a2dd74b..eaf9997fb4 100644
--- a/sapi/phpdbg/phpdbg_eol.c
+++ b/sapi/phpdbg/phpdbg_eol.c
@@ -23,7 +23,7 @@
#include "phpdbg.h"
#include "phpdbg_eol.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
#define EOL_LIST_LEN 4
struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = {
diff --git a/sapi/phpdbg/phpdbg_frame.c b/sapi/phpdbg/phpdbg_frame.c
index ab1b554f76..f64d18b4bb 100644
--- a/sapi/phpdbg/phpdbg_frame.c
+++ b/sapi/phpdbg/phpdbg_frame.c
@@ -24,7 +24,7 @@
#include "phpdbg_frame.h"
#include "phpdbg_list.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
void phpdbg_restore_frame(void) /* {{{ */
{
@@ -36,8 +36,6 @@ void phpdbg_restore_frame(void) /* {{{ */
/* move things back */
EG(current_execute_data) = PHPDBG_FRAME(execute_data);
-
- EG(scope) = PHPDBG_EX(func)->op_array.scope;
} /* }}} */
void phpdbg_switch_frame(int frame) /* {{{ */
@@ -78,8 +76,6 @@ void phpdbg_switch_frame(int frame) /* {{{ */
/* backup things and jump back */
PHPDBG_FRAME(execute_data) = EG(current_execute_data);
EG(current_execute_data) = execute_data;
-
- EG(scope) = PHPDBG_EX(func)->op_array.scope;
}
phpdbg_notice("frame", "id=\"%d\"", "Switched to frame #%d", frame);
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index b93effc8eb..d01184b102 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -25,7 +25,7 @@
#include "phpdbg_eol.h"
#include "zend.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
/* {{{ Commands Table */
#define PHPDBG_COMMAND_HELP_D(name, tip, alias, action) \
@@ -809,9 +809,11 @@ phpdbg_help_text_t phpdbg_help_text[] = {
},
{"run",
-"Enter the vm, startinging execution. Execution will then continue until the next breakpoint "
+"Enter the vm, starting execution. Execution will then continue until the next breakpoint "
"or completion of the script. Add parameters you want to use as $argv" CR CR
+
"**Examples**" CR CR
+
" $P run" CR
" $P r" CR
" Will cause execution of the context, if it is set" CR CR
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index 5d7608fa76..ddd8229c08 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -25,7 +25,7 @@
#include "phpdbg_bp.h"
#include "phpdbg_prompt.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+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)
diff --git a/sapi/phpdbg/phpdbg_io.c b/sapi/phpdbg/phpdbg_io.c
index 2e41bdd4fb..b2f4ba7c0d 100644
--- a/sapi/phpdbg/phpdbg_io.c
+++ b/sapi/phpdbg/phpdbg_io.c
@@ -45,7 +45,7 @@
#include <poll.h>
#endif
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
/* is easy to generalize ... but not needed for now */
PHPDBG_API int phpdbg_consume_stdin_line(char *buf) {
diff --git a/sapi/phpdbg/phpdbg_lexer.c b/sapi/phpdbg/phpdbg_lexer.c
index 36c6f422bd..10af103fb0 100644
--- a/sapi/phpdbg/phpdbg_lexer.c
+++ b/sapi/phpdbg/phpdbg_lexer.c
@@ -28,7 +28,7 @@
#define RAW 2
#define INITIAL 3
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
PHPDBG_G(parser_stack) = stack;
diff --git a/sapi/phpdbg/phpdbg_lexer.l b/sapi/phpdbg/phpdbg_lexer.l
index 5d1c8b77ba..21c4569480 100644
--- a/sapi/phpdbg/phpdbg_lexer.l
+++ b/sapi/phpdbg/phpdbg_lexer.l
@@ -26,7 +26,7 @@
#define RAW 2
#define INITIAL 3
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
void phpdbg_init_lexer (phpdbg_param_t *stack, char *input) {
PHPDBG_G(parser_stack) = stack;
diff --git a/sapi/phpdbg/phpdbg_list.c b/sapi/phpdbg/phpdbg_list.c
index 8bcf6c362b..ca73209114 100644
--- a/sapi/phpdbg/phpdbg_list.c
+++ b/sapi/phpdbg/phpdbg_list.c
@@ -33,7 +33,7 @@
#include "php_streams.h"
#include "zend_exceptions.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+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)
@@ -200,11 +200,12 @@ void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */
/* search active scope if begins with period */
if (func_name[0] == '.') {
- if (EG(scope)) {
+ zend_class_entry *scope = zend_get_executed_scope();
+ if (scope) {
func_name++;
func_name_len--;
- func_table = &EG(scope)->function_table;
+ func_table = &scope->function_table;
} else {
phpdbg_error("inactive", "type=\"noclasses\"", "No active class");
return;
@@ -232,6 +233,7 @@ void phpdbg_list_function_byname(const char *str, size_t len) /* {{{ */
efree(func_name);
} /* }}} */
+/* Note: do not free the original file handler, let original compile_file() or caller do that. Caller may rely on its value to check success */
zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
phpdbg_file_source data, *dataptr;
zend_file_handle fake;
@@ -242,7 +244,7 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
char resolved_path_buf[MAXPATHLEN];
if (zend_stream_fixup(file, &bufptr, &data.len) == FAILURE) {
- return NULL;
+ return PHPDBG_G(compile_file)(file, type);
}
data.buf = emalloc(data.len + ZEND_MMAP_AHEAD + 1);
@@ -279,6 +281,10 @@ zend_op_array *phpdbg_compile_file(zend_file_handle *file, int type) {
if (ret == NULL) {
efree(data.buf);
efree(dataptr);
+
+ fake.opened_path = NULL;
+ zend_file_handle_dtor(&fake);
+
return NULL;
}
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index ccd7337e5c..44119c9e51 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -25,7 +25,7 @@
#include "phpdbg_utils.h"
#include "ext/standard/php_string.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
static inline const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
{
@@ -74,7 +74,7 @@ char *phpdbg_decode_input_op(
} else if (ZEND_VM_OP_NUM == (flags & ZEND_VM_OP_MASK)) {
spprintf(&result, 0, "%" PRIu32, op.num);
} else if (ZEND_VM_OP_TRY_CATCH == (flags & ZEND_VM_OP_MASK)) {
- if (opline->opcode != ZEND_FAST_RET || opline->extended_value) {
+ if (op.num != (uint32_t)-1) {
spprintf(&result, 0, "try-catch(%" PRIu32 ")", op.num);
}
} else if (ZEND_VM_OP_LIVE_RANGE == (flags & ZEND_VM_OP_MASK)) {
@@ -99,21 +99,6 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *opline) /*{{{ */
uint32_t flags = zend_get_opcode_flags(opline->opcode);
char *result, *decode[4] = {NULL, NULL, NULL, NULL};
- /* EX */
- switch (opline->opcode) {
- case ZEND_FAST_CALL:
- if (opline->extended_value == ZEND_FAST_CALL_FROM_FINALLY) {
- decode[0] = estrdup("FAST_CALL<FROM_FINALLY>");
- }
- break;
- case ZEND_FAST_RET:
- if (opline->extended_value != 0) {
- spprintf(&decode[0], 0, "FAST_RET<%s>",
- opline->extended_value == ZEND_FAST_RET_TO_CATCH ? "TO_CATCH" : "TO_FINALLY");
- }
- break;
- }
-
/* OP1 */
decode[1] = phpdbg_decode_input_op(
ops, opline, opline->op1, opline->op1_type, ZEND_VM_OP1_FLAGS(flags));
diff --git a/sapi/phpdbg/phpdbg_out.c b/sapi/phpdbg/phpdbg_out.c
index 912e9e8092..90940ca68c 100644
--- a/sapi/phpdbg/phpdbg_out.c
+++ b/sapi/phpdbg/phpdbg_out.c
@@ -30,7 +30,7 @@
# include "win32/time.h"
#endif
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
/* copied from php-src/main/snprintf.c and slightly modified */
/*
diff --git a/sapi/phpdbg/phpdbg_parser.c b/sapi/phpdbg/phpdbg_parser.c
index 8a33a10780..c5222a0289 100644
--- a/sapi/phpdbg/phpdbg_parser.c
+++ b/sapi/phpdbg/phpdbg_parser.c
@@ -94,7 +94,7 @@
#undef yyerror
static int yyerror(const char *msg);
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
#ifdef _MSC_VER
#define YYMALLOC malloc
diff --git a/sapi/phpdbg/phpdbg_parser.y b/sapi/phpdbg/phpdbg_parser.y
index 2b8f357763..df9be36eee 100644
--- a/sapi/phpdbg/phpdbg_parser.y
+++ b/sapi/phpdbg/phpdbg_parser.y
@@ -21,7 +21,7 @@
#undef yyerror
static int yyerror(const char *msg);
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
#ifdef _MSC_VER
#define YYMALLOC malloc
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index 00209cb239..034354a9e7 100644
--- a/sapi/phpdbg/phpdbg_print.c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -24,7 +24,7 @@
#include "phpdbg_opcode.h"
#include "phpdbg_prompt.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+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)
@@ -217,11 +217,13 @@ PHPDBG_PRINT(func) /* {{{ */
zend_string *lcname;
/* search active scope if begins with period */
if (func_name[0] == '.') {
- if (EG(scope)) {
+ zend_class_entry *scope = zend_get_executed_scope();
+
+ if (scope) {
func_name++;
func_name_len--;
- func_table = &EG(scope)->function_table;
+ func_table = &scope->function_table;
} else {
phpdbg_error("inactive", "type=\"noclasses\"", "No active class");
return SUCCESS;
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index edfdba688e..2ca1368751 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -48,7 +48,7 @@
#error "phpdbg can only be built with CALL zend vm kind"
#endif
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
extern int phpdbg_startup_run;
#ifdef HAVE_LIBDL
@@ -120,8 +120,7 @@ static inline int phpdbg_call_register(phpdbg_param_t *stack) /* {{{ */
ZVAL_STRINGL(&fci.function_name, lc_name, name->len);
fci.size = sizeof(zend_fcall_info);
- fci.function_table = &PHPDBG_G(registered);
- fci.symbol_table = zend_rebuild_symbol_table();
+ //???fci.symbol_table = zend_rebuild_symbol_table();
fci.object = NULL;
fci.retval = &fretval;
fci.no_separation = 1;
@@ -688,7 +687,7 @@ PHPDBG_COMMAND(run) /* {{{ */
}
/* clean up from last execution */
- if (ex && ex->symbol_table) {
+ if (ex && (ZEND_CALL_INFO(ex) & ZEND_CALL_HAS_SYMBOL_TABLE)) {
zend_hash_clean(ex->symbol_table);
} else {
zend_rebuild_symbol_table();
@@ -798,7 +797,6 @@ PHPDBG_COMMAND(ev) /* {{{ */
zval retval;
zend_execute_data *original_execute_data = EG(current_execute_data);
- zend_class_entry *original_scope = EG(scope);
zend_vm_stack original_stack = EG(vm_stack);
zend_object *ex = NULL;
@@ -846,7 +844,6 @@ PHPDBG_COMMAND(ev) /* {{{ */
OBJ_RELEASE(ex);
}
EG(current_execute_data) = original_execute_data;
- EG(scope) = original_scope;
EG(vm_stack_top) = original_stack->top;
EG(vm_stack_end) = original_stack->end;
EG(vm_stack) = original_stack;
@@ -1047,7 +1044,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)
if (!handle) {
#if PHP_WIN32
char *err = GET_DL_ERROR();
- if (err && *err != "") {
+ if (err && err[0]) {
phpdbg_error("dl", "type=\"unknown\"", "%s", err);
LocalFree(err);
} else {
diff --git a/sapi/phpdbg/phpdbg_set.c b/sapi/phpdbg/phpdbg_set.c
index dd78b78697..47ecbd08b6 100644
--- a/sapi/phpdbg/phpdbg_set.c
+++ b/sapi/phpdbg/phpdbg_set.c
@@ -25,7 +25,7 @@
#include "phpdbg_bp.h"
#include "phpdbg_prompt.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+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)
diff --git a/sapi/phpdbg/phpdbg_sigio_win32.c b/sapi/phpdbg/phpdbg_sigio_win32.c
index 5183d1fb66..db334a0dc5 100644
--- a/sapi/phpdbg/phpdbg_sigio_win32.c
+++ b/sapi/phpdbg/phpdbg_sigio_win32.c
@@ -23,7 +23,7 @@
#include "phpdbg_sigio_win32.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
VOID
diff --git a/sapi/phpdbg/phpdbg_sigsafe.c b/sapi/phpdbg/phpdbg_sigsafe.c
index 54af08ec5b..2f987b3a15 100644
--- a/sapi/phpdbg/phpdbg_sigsafe.c
+++ b/sapi/phpdbg/phpdbg_sigsafe.c
@@ -1,7 +1,7 @@
#include "phpdbg_sigsafe.h"
#include "phpdbg.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
#define STR(x) #x
#define EXP_STR(x) STR(x)
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index a944d256ae..6f42665809 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -38,7 +38,7 @@
# endif
#endif
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
/* {{{ color structures */
const static phpdbg_color_t colors[] = {
@@ -804,6 +804,18 @@ char *phpdbg_short_zval_print(zval *zv, int maxlen) /* {{{ */
break;
case IS_DOUBLE:
spprintf(&decode, 0, "%.*G", 14, Z_DVAL_P(zv));
+
+ /* Make sure it looks like a float */
+ if (zend_finite(Z_DVAL_P(zv)) && !strchr(decode, '.')) {
+ size_t len = strlen(decode);
+ char *decode2 = emalloc(len + strlen(".0") + 1);
+ memcpy(decode2, decode, len);
+ decode2[len] = '.';
+ decode2[len+1] = '0';
+ decode2[len+2] = '\0';
+ efree(decode);
+ decode = decode2;
+ }
break;
case IS_STRING: {
int i;
diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c
index c3ae23b7cd..c7dcd4fbd4 100644
--- a/sapi/phpdbg/phpdbg_wait.c
+++ b/sapi/phpdbg/phpdbg_wait.c
@@ -21,7 +21,7 @@
#include "ext/standard/php_var.h"
#include "ext/standard/basic_functions.h"
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
static void phpdbg_rebuild_http_globals_array(int type, const char *name) {
zval *zvp;
@@ -281,11 +281,6 @@ void phpdbg_webdata_decompress(char *msg, int len) {
pefree(elm, zend_extensions.persistent);
zend_extensions.count--;
} else {
-/* zend_hash_get_current_key_zval_ex(Z_ARRVAL_PP(zvpp), &key, &hpos);
- if (Z_TYPE(key) == IS_LONG) {
- zend_hash_index_del(Z_ARRVAL_PP(zvpp), Z_LVAL(key));
- }
-*/
zend_hash_del(Z_ARRVAL_P(zvp), strkey);
}
}
diff --git a/sapi/phpdbg/phpdbg_watch.c b/sapi/phpdbg/phpdbg_watch.c
index b1f3fee2ac..0224ff4fd1 100644
--- a/sapi/phpdbg/phpdbg_watch.c
+++ b/sapi/phpdbg/phpdbg_watch.c
@@ -80,7 +80,7 @@
# include <sys/mman.h>
#endif
-ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
+ZEND_EXTERN_MODULE_GLOBALS(phpdbg)
const phpdbg_command_t phpdbg_watch_commands[] = {
PHPDBG_COMMAND_D_EX(array, "create watchpoint on an array", 'a', watch_array, &phpdbg_prompt_commands[24], "s", 0),
@@ -680,7 +680,9 @@ static int phpdbg_watchpoint_parse_step(char *name, size_t namelen, char *key, s
}
static int phpdbg_watchpoint_parse_symtables(char *input, size_t len, int (*callback)(phpdbg_watchpoint_t *)) {
- if (EG(scope) && len >= 5 && !memcmp("$this", input, 5)) {
+ zend_class_entry *scope = zend_get_executed_scope();
+
+ if (scope && len >= 5 && !memcmp("$this", input, 5)) {
zend_hash_str_add(EG(current_execute_data)->symbol_table, ZEND_STRL("this"), &EG(current_execute_data)->This);
}
diff --git a/sapi/phpdbg/tests/exceptions_003.phpt b/sapi/phpdbg/tests/exceptions_003.phpt
index 37e7289092..2a982bcbe3 100644
--- a/sapi/phpdbg/tests/exceptions_003.phpt
+++ b/sapi/phpdbg/tests/exceptions_003.phpt
@@ -25,7 +25,7 @@ prompt> [L7 %s ECHO "ok "
00008: }
00009: } catch (Error $e) {
prompt> ok
-[L7 %s FAST_RET<TO_CATCH> ~%d try-catch(0) %s]
+[L7 %s FAST_RET ~%d try-catch(0) %s]
[L9 %s CATCH "Error" $e 1 %s]
>00005: x();
00006: } finally {
diff --git a/sapi/phpdbg/tests/print_001.phpt b/sapi/phpdbg/tests/print_001.phpt
index a4f300572a..1f7a5ac0b9 100644
--- a/sapi/phpdbg/tests/print_001.phpt
+++ b/sapi/phpdbg/tests/print_001.phpt
@@ -34,7 +34,7 @@ prompt> [Context %s (11 ops)]
L1-19 {main}() %s - %s + 11 ops
L4 #0 NOP
L14 #1 NOP
- L18 #2 NEW "Foo\\Bar" J4 @1
+ L18 #2 NEW "Foo\\Bar" @1
L18 #3 DO_FCALL
L18 #4 INIT_METHOD_CALL @1 "Foo"
L18 #5 SEND_VAL_EX "test" 1
diff --git a/sapi/phpdbg/tests/stepping_001.phpt b/sapi/phpdbg/tests/stepping_001.phpt
index ec9def278f..9366550f56 100644
--- a/sapi/phpdbg/tests/stepping_001.phpt
+++ b/sapi/phpdbg/tests/stepping_001.phpt
@@ -34,7 +34,7 @@ prompt> [L10 %s ECHO "ok"
00011: } finally {
00012: echo " ... ok";
prompt> ok
-[L11 %s FAST_CALL J8 try-catch(0) ~%d %s]
+[L11 %s FAST_CALL J8 ~%d %s]
>00011: } finally {
00012: echo " ... ok";
00013: }