From 0e1c9de6ad9d6f05953e309605eca02947c04c44 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Mon, 16 Dec 2019 17:53:59 +0000 Subject: [PATCH] Fixed issue #1727: Debugger stops more often than expected due to resolving breakpoints --- run-xdebug-tests.php | 2 +- src/base/base.c | 6 +- src/base/stack.c | 27 +++- src/base/stack.h | 1 + src/coverage/code_coverage.c | 25 --- src/coverage/code_coverage_private.h | 2 - src/debugger/debugger.c | 191 ++++++++++++++++++++-- src/debugger/debugger.h | 9 ++ src/debugger/debugger_private.h | 17 ++ src/debugger/handler_dbgp.c | 224 ++++++++------------------ src/debugger/handler_dbgp.h | 8 +- src/debugger/handlers.h | 11 +- src/lib/private.h | 1 - tests/debugger/bug00842-php7-001.phpt | 53 +++--- tests/debugger/bug00842-php7-004.phpt | 33 ++-- tests/debugger/bug01335.phpt | 41 ++--- tests/debugger/bug01388-01.phpt | 44 ++--- tests/debugger/bug01388-02-php70.phpt | 26 +-- tests/debugger/bug01388-02-php74.phpt | 25 +-- tests/debugger/bug01388-03-php70.phpt | 34 ++-- tests/debugger/bug01388-03-php74.phpt | 35 ++-- tests/debugger/bug01388-04.phpt | 21 ++- tests/debugger/bug01388-05.phpt | 21 ++- tests/debugger/bug01388-06.phpt | 21 ++- tests/debugger/bug01388-07.phpt | 47 +++--- tests/debugger/bug01388-08-php70.phpt | 18 +-- tests/debugger/bug01388-08-php74.phpt | 8 +- tests/debugger/bug01388-09.phpt | 34 ++-- tests/debugger/bug01388-10-php70.phpt | 43 +++-- tests/debugger/bug01388-10-php74.phpt | 40 ++--- tests/debugger/bug01388-11-php70.phpt | 24 ++- tests/debugger/bug01388-11-php74.phpt | 19 +-- tests/debugger/bug01388-12.phpt | 23 +-- tests/debugger/bug01388-13-php70.phpt | 26 +-- tests/debugger/bug01388-13-php74.phpt | 25 +-- tests/debugger/bug01388-14.phpt | 32 ++-- tests/debugger/bug01388-15.phpt | 62 ++++--- tests/debugger/bug01388-16.phpt | 44 +++-- tests/debugger/bug01388-17.phpt | 26 +-- tests/debugger/bug01388-18.phpt | 25 +-- tests/debugger/bug01388-19.phpt | 47 +++--- tests/debugger/bug01388-20.phpt | 21 ++- tests/debugger/bug01388-21.phpt | 61 ++++--- tests/debugger/bug01660.phpt | 24 +-- tests/debugger/remote_log1.phpt | 1 + 45 files changed, 837 insertions(+), 691 deletions(-) diff --git a/run-xdebug-tests.php b/run-xdebug-tests.php index f16c0fb55..1ccc6389d 100644 --- a/run-xdebug-tests.php +++ b/run-xdebug-tests.php @@ -323,7 +323,7 @@ function write_information() 'session' => array('session.auto_start=0'), 'tidy' => array('tidy.clean_output=0'), 'zlib' => array('zlib.output_compression=Off'), - 'xdebug' => array('xdebug.default_enable=0','xdebug.remote_enable=0'), + 'xdebug' => array('xdebug.default_enable=0','xdebug.remote_enable=0','xdebug.remote_log_level=20'), 'mbstring' => array('mbstring.func_overload=0'), ); diff --git a/src/base/base.c b/src/base/base.c index 0cbcd9a36..15da08aca 100644 --- a/src/base/base.c +++ b/src/base/base.c @@ -148,6 +148,7 @@ static zend_op_array *xdebug_compile_file(zend_file_handle *file_handle, int typ if (op_array) { xdebug_coverage_compile_file(op_array); + xdebug_debugger_compile_file(op_array); } return op_array; } @@ -198,11 +199,6 @@ static void function_stack_entry_dtor(void *dummy, void *elem) e->profile.call_list = NULL; } - if (e->executable_lines_cache) { - xdebug_set_free(e->executable_lines_cache); - e->executable_lines_cache = NULL; - } - xdfree(e); } } diff --git a/src/base/stack.c b/src/base/stack.c index 2aa04074c..20d7021b5 100644 --- a/src/base/stack.c +++ b/src/base/stack.c @@ -912,6 +912,32 @@ void xdebug_func_dtor(xdebug_func *elem) xdfree(elem); } +void xdebug_build_fname_from_oparray(xdebug_func *tmp, zend_op_array *opa) +{ + int closure = 0; + + memset(tmp, 0, sizeof(xdebug_func)); + + if (opa->function_name) { + if (xdebug_function_name_is_closure(STR_NAME_VAL(opa->function_name))) { + tmp->function = xdebug_wrap_closure_location_around_function_name(opa, STR_NAME_VAL(opa->function_name)); + closure = 1; + } else { + tmp->function = xdstrdup(STR_NAME_VAL(opa->function_name)); + } + } else { + tmp->function = xdstrdup("{main}"); + tmp->type = XFUNC_MAIN; + } + + if (opa->scope && !closure) { + tmp->type = XFUNC_MEMBER; + tmp->class = xdstrdup(STR_NAME_VAL(opa->scope->name)); + } else { + tmp->type = XFUNC_NORMAL; + } +} + void xdebug_build_fname(xdebug_func *tmp, zend_execute_data *edata) { memset(tmp, 0, sizeof(xdebug_func)); @@ -1073,7 +1099,6 @@ function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_a tmp->is_variadic = 0; tmp->filtered_tracing = 0; tmp->filtered_code_coverage = 0; - tmp->executable_lines_cache = NULL; XG_BASE(function_count)++; tmp->function_nr = XG_BASE(function_count); diff --git a/src/base/stack.h b/src/base/stack.h index fa99b34ba..0277bbefe 100644 --- a/src/base/stack.h +++ b/src/base/stack.h @@ -28,6 +28,7 @@ char* xdebug_wrap_closure_location_around_function_name(zend_op_array *opa, char void xdebug_func_dtor_by_ref(xdebug_func *elem); /* TODO: Remove this API */ void xdebug_func_dtor(xdebug_func *elem); void xdebug_build_fname(xdebug_func *tmp, zend_execute_data *edata); +void xdebug_build_fname_from_oparray(xdebug_func *tmp, zend_op_array *opa); function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_array *op_array, int type); void xdebug_append_error_head(xdebug_str *str, int html, const char *error_type_str); void xdebug_append_error_description(xdebug_str *str, int html, const char *error_type_str, const char *buffer, const char *error_filename, const int error_lineno); diff --git a/src/coverage/code_coverage.c b/src/coverage/code_coverage.c index 2da103af7..d272d56b7 100644 --- a/src/coverage/code_coverage.c +++ b/src/coverage/code_coverage.c @@ -438,31 +438,6 @@ static void xdebug_analyse_oparray(zend_op_array *opa, xdebug_set *set, xdebug_b } } -void xdebug_build_fname_from_oparray(xdebug_func *tmp, zend_op_array *opa) -{ - int closure = 0; - - memset(tmp, 0, sizeof(xdebug_func)); - - if (opa->function_name) { - if (xdebug_function_name_is_closure(STR_NAME_VAL(opa->function_name))) { - tmp->function = xdebug_wrap_closure_location_around_function_name(opa, STR_NAME_VAL(opa->function_name)); - closure = 1; - } else { - tmp->function = xdstrdup(STR_NAME_VAL(opa->function_name)); - } - } else { - tmp->function = xdstrdup("{main}"); - } - - if (opa->scope && !closure) { - tmp->type = XFUNC_MEMBER; - tmp->class = xdstrdup(STR_NAME_VAL(opa->scope->name)); - } else { - tmp->type = XFUNC_NORMAL; - } -} - static void prefill_from_oparray(char *filename, zend_op_array *op_array) { unsigned int i; diff --git a/src/coverage/code_coverage_private.h b/src/coverage/code_coverage_private.h index 2f55f9cf7..bbc1cd346 100644 --- a/src/coverage/code_coverage_private.h +++ b/src/coverage/code_coverage_private.h @@ -45,8 +45,6 @@ typedef struct xdebug_coverage_function { xdebug_coverage_file *xdebug_coverage_file_ctor(char *filename); -void xdebug_build_fname_from_oparray(xdebug_func *tmp, zend_op_array *opa); - xdebug_coverage_function *xdebug_coverage_function_ctor(char *function_name); void xdebug_coverage_function_dtor(void *data); void xdebug_code_coverage_start_of_function(zend_op_array *op_array, char *function_name); diff --git a/src/debugger/debugger.c b/src/debugger/debugger.c index 23d24f43b..6fd595bb6 100644 --- a/src/debugger/debugger.c +++ b/src/debugger/debugger.c @@ -22,12 +22,15 @@ #include "zend_exceptions.h" #include "debugger_private.h" +#include "base/stack.h" extern ZEND_DECLARE_MODULE_GLOBALS(xdebug); static size_t (*xdebug_orig_ub_write)(const char *string, size_t len); static size_t xdebug_ub_write(const char *string, size_t length); +static void xdebug_line_list_dtor(xdebug_lines_list *line_list); + PHP_INI_MH(OnUpdateDebugMode) { if (!new_value) { @@ -123,14 +126,6 @@ void xdebug_debugger_set_program_name(zend_string *filename) } } -void xdebug_debugger_register_eval(function_stack_entry *fse) -{ - if (xdebug_is_debug_connection_active_for_current_pid() && XG_DBG(context).handler->register_eval_id) { - XG_DBG(context).handler->register_eval_id(&(XG_DBG(context)), fse); - } -} - - /* Remote debugger helper functions */ static int xdebug_handle_hit_value(xdebug_brk_info *brk_info) { @@ -312,11 +307,11 @@ void xdebug_debugger_throw_exception_hook(zend_class_entry * exception_ce, zval ce_ptr = ce_ptr->parent; } while (!exception_breakpoint_found && ce_ptr); } - +#if 0 if (XG_DBG(context).resolved_breakpoints && exception_breakpoint_found) { - XG_DBG(context).handler->resolve_breakpoints(&(XG_DBG(context)), XDEBUG_BREAKPOINT_TYPE_EXCEPTION, extra_brk_info); + XG_DBG(context).handler->resolve_breakpoints(&(XG_DBG(context)), extra_brk_info); } - +#endif if (exception_breakpoint_found && xdebug_handle_hit_value(extra_brk_info)) { if (!XG_DBG(context).handler->remote_breakpoint( &(XG_DBG(context)), XG_BASE(stack), @@ -370,11 +365,6 @@ static int handle_breakpoints(function_stack_entry *fse, int breakpoint_type) char *tmp_name = NULL; size_t tmp_len = 0; - /* When we first enter a user defined function, we need to resolve breakpoints for this function */ - if (XG_DBG(context).resolved_breakpoints && breakpoint_type == XDEBUG_BREAKPOINT_TYPE_CALL && fse->user_defined == XDEBUG_USER_DEFINED) { - XG_DBG(context).handler->resolve_breakpoints(&(XG_DBG(context)), XDEBUG_BREAKPOINT_TYPE_LINE|XDEBUG_BREAKPOINT_TYPE_CONDITIONAL|XDEBUG_BREAKPOINT_TYPE_CALL|XDEBUG_BREAKPOINT_TYPE_RETURN, fse); - } - /* Function breakpoints */ if (fse->function.type == XFUNC_NORMAL) { if (xdebug_hash_find(XG_DBG(context).function_breakpoints, fse->function.function, strlen(fse->function.function), (void *) &extra_brk_info)) { @@ -539,7 +529,9 @@ void xdebug_debugger_rinit(void) } xdebug_mark_debug_connection_not_active(); + XG_DBG(breakpoints_allowed) = 1; + XG_DBG(breakable_lines_map) = xdebug_hash_alloc(2048, (xdebug_hash_dtor_t) xdebug_line_list_dtor); XG_DBG(remote_log_file) = NULL; /* Initialize some debugger context properties */ @@ -571,8 +563,175 @@ void xdebug_debugger_post_deactivate(void) xdfree(XG_DBG(context).list.last_file); XG_DBG(context).list.last_file = NULL; } + + xdebug_hash_destroy(XG_DBG(breakable_lines_map)); +} + +xdebug_set *xdebug_debugger_get_breakable_lines_from_oparray(zend_op_array *opa) +{ + int i; + xdebug_set *tmp; + + tmp = xdebug_set_create(opa->line_end); + + for (i = 0; i < opa->last; i++ ) { + if (opa->opcodes[i].opcode == ZEND_EXT_STMT ) { + xdebug_set_add(tmp, opa->opcodes[i].lineno); + } + } + + return tmp; +} + + +/* {{{ function/lines map collection helpers */ +static void xdebug_function_lines_map_dtor(xdebug_function_lines_map_item *lines_map) +{ + xdebug_set_free(lines_map->lines_breakable); + xdfree(lines_map); +} + +static void xdebug_line_list_dtor(xdebug_lines_list *line_list) +{ + size_t i; + + for (i = 0; i < line_list->count; i++) { + xdebug_function_lines_map_dtor(line_list->functions[i]); + } + xdfree(line_list->functions); + xdfree(line_list); +} + +static xdebug_lines_list *get_file_function_line_list(zend_string *filename) +{ + xdebug_lines_list *lines_list; + + if (xdebug_hash_find(XG_DBG(breakable_lines_map), ZSTR_VAL(filename), ZSTR_LEN(filename), (void *) &lines_list)) { + return lines_list; + } + + lines_list = xdmalloc(sizeof(xdebug_lines_list)); + lines_list->count = 0; + lines_list->size = 0; + lines_list->functions = NULL; + + xdebug_hash_add(XG_DBG(breakable_lines_map), ZSTR_VAL(filename), ZSTR_LEN(filename), (void *) lines_list); + + return lines_list; +} + +static void add_function_to_lines_list(xdebug_lines_list *lines_list, zend_op_array *opa) +{ + xdebug_function_lines_map_item *map_item = xdmalloc(sizeof(xdebug_function_lines_map_item)); + + map_item->line_start = opa->line_start; + map_item->line_end = opa->line_end; + map_item->line_span = opa->line_end - opa->line_start; + map_item->lines_breakable = xdebug_debugger_get_breakable_lines_from_oparray(opa); + + if (lines_list->count >= lines_list->size) { + lines_list->size = lines_list->size == 0 ? 16 : lines_list->size * 2; + lines_list->functions = xdrealloc(lines_list->functions, sizeof(xdebug_function_lines_map_item *) * lines_list->size); + } + lines_list->functions[lines_list->count] = map_item; + lines_list->count++; +} +/* }}} */ + +static void resolve_breakpoints_for_function(xdebug_lines_list *lines_list, zend_op_array *opa) +{ + if (!ZEND_USER_CODE(opa->type)) { + return; + } + + add_function_to_lines_list(lines_list, opa); +} + +static void resolve_breakpoints_for_class(xdebug_lines_list *file_function_lines_list, zend_class_entry *ce) +{ + zend_op_array *function_op_array; + + ZEND_HASH_FOREACH_PTR(&ce->function_table, function_op_array) { + resolve_breakpoints_for_function(file_function_lines_list, function_op_array); + } ZEND_HASH_FOREACH_END(); +} + +void xdebug_debugger_compile_file(zend_op_array *op_array) +{ + zend_op_array *function_op_array; + zend_class_entry *class_entry; + xdebug_lines_list *file_function_lines_list; + + if (!XINI_DBG(remote_enable)) { + return; + } + + file_function_lines_list = get_file_function_line_list(op_array->filename); + + ZEND_HASH_REVERSE_FOREACH_PTR(CG(function_table), function_op_array) { + if (_idx == XG_DBG(function_count)) { + break; + } + resolve_breakpoints_for_function(file_function_lines_list, function_op_array); + } ZEND_HASH_FOREACH_END(); + XG_DBG(function_count) = CG(function_table)->nNumUsed; + + ZEND_HASH_REVERSE_FOREACH_PTR(CG(class_table), class_entry) { + if (_idx == XG_DBG(class_count)) { + break; + } + resolve_breakpoints_for_class(file_function_lines_list, class_entry); + } ZEND_HASH_FOREACH_END(); + XG_DBG(class_count) = CG(class_table)->nNumUsed; + + add_function_to_lines_list(file_function_lines_list, op_array); + + if (!xdebug_is_debug_connection_active_for_current_pid()) { + return; + } + + XG_DBG(context).handler->resolve_breakpoints( + &(XG_DBG(context)), + op_array->filename + ); } +static void resolve_breakpoints_for_eval(int eval_id, zend_op_array *opa) +{ + xdebug_lines_list *lines_list; + char *eval_filename = xdebug_sprintf("dbgp://%d", eval_id); + zend_string *eval_string = zend_string_init(eval_filename, strlen(eval_filename), 0); + + lines_list = get_file_function_line_list(eval_string); + add_function_to_lines_list(lines_list, opa); + + resolve_breakpoints_for_function(lines_list, opa); + + if (!xdebug_is_debug_connection_active_for_current_pid()) { + zend_string_release(eval_string); + xdfree(eval_filename); + return; + } + + XG_DBG(context).handler->resolve_breakpoints( + &(XG_DBG(context)), + eval_string + ); + + zend_string_release(eval_string); + xdfree(eval_filename); +} + +void xdebug_debugger_register_eval(function_stack_entry *fse) +{ + if (xdebug_is_debug_connection_active_for_current_pid() && XG_DBG(context).handler->register_eval_id) { + int eval_id = XG_DBG(context).handler->register_eval_id(&(XG_DBG(context)), fse); + + resolve_breakpoints_for_eval(eval_id, fse->op_array); + } +} + + PHP_FUNCTION(xdebug_break) { /* Start JIT if requested and not yet enabled */ diff --git a/src/debugger/debugger.h b/src/debugger/debugger.h index 39f8fd8be..1df8a756f 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -37,6 +37,11 @@ typedef struct _xdebug_debugger_globals_t { char *ide_key; /* As Xdebug uses it, from environment, USER, USERNAME or empty */ FILE *remote_log_file; /* File handler for protocol log */ + /* breakpoint resolving */ + size_t function_count; + size_t class_count; + xdebug_hash *breakable_lines_map; + /* output redirection */ int stdout_mode; } xdebug_debugger_globals_t; @@ -66,6 +71,8 @@ int xdebug_debugger_bailout_if_no_exec_requested(void); void xdebug_debugger_set_program_name(zend_string *filename); void xdebug_debugger_register_eval(function_stack_entry *fse); +xdebug_set *xdebug_debugger_get_breakable_lines_from_oparray(zend_op_array *opa); + void xdebug_debugger_statement_call(char *file, int file_len, int lineno); void xdebug_debugger_throw_exception_hook(zend_class_entry * exception_ce, zval *file, zval *line, zval *code, char *code_str, zval *message); void xdebug_debugger_error_cb(const char *error_filename, int error_lineno, int type, char *error_type_str, char *buffer); @@ -78,6 +85,8 @@ void xdebug_debugger_minfo(void); void xdebug_debugger_rinit(void); void xdebug_debugger_post_deactivate(void); +void xdebug_debugger_compile_file(zend_op_array *op_array); + PHP_FUNCTION(xdebug_break); diff --git a/src/debugger/debugger_private.h b/src/debugger/debugger_private.h index 61f38881d..c89a621b3 100644 --- a/src/debugger/debugger_private.h +++ b/src/debugger/debugger_private.h @@ -30,6 +30,23 @@ struct _fd_buf { int buffer_size; }; +typedef struct _xdebug_function_lines_map_item xdebug_function_lines_map_item; + +struct _xdebug_function_lines_map_item { + size_t line_start; + size_t line_end; + size_t line_span; + xdebug_set *lines_breakable; +}; + +typedef struct _xdebug_lines_list xdebug_lines_list; + +struct _xdebug_lines_list { + size_t count; /* How many function/line mappings are in the list */ + size_t size; /* How many function/line mappings are allocated */ + xdebug_function_lines_map_item **functions; +}; + #define XG_DBG(v) (XG(globals.debugger.v)) #define XINI_DBG(v) (XG(settings.debugger.v)) diff --git a/src/debugger/handler_dbgp.c b/src/debugger/handler_dbgp.c index 77cdefe5a..9c441b9df 100644 --- a/src/debugger/handler_dbgp.c +++ b/src/debugger/handler_dbgp.c @@ -73,7 +73,7 @@ xdebug_remote_handler xdebug_handler_dbgp = { static char *create_eval_key_file(char *filename, int lineno); static char *create_eval_key_id(int id); -static void line_breakpoint_resolve_helper(xdebug_con *context, function_stack_entry *fse, xdebug_brk_info *brk_info); +static void line_breakpoint_resolve_helper(xdebug_con *context, xdebug_lines_list *lines_list, xdebug_brk_info *brk_info); /***************************************************************************** ** Constants and strings for statii and reasons @@ -588,8 +588,8 @@ static void breakpoint_brk_info_add(xdebug_xml_node *xml, xdebug_brk_info *brk_i breakpoint_brk_info_add_resolved(xml, brk_info); if (brk_info->file) { if (is_dbgp_url(brk_info->file)) { - xdebug_xml_add_attribute_ex(xml, "function", xdstrdup(brk_info->file), 0, 1); - } else { + xdebug_xml_add_attribute_ex(xml, "filename", xdstrdup(brk_info->file), 0, 1); + } else { xdebug_xml_add_attribute_ex(xml, "filename", xdebug_path_to_url(brk_info->file), 0, 1); } } @@ -787,8 +787,6 @@ static void breakpoint_do_action(DBGP_FUNC_PARAMETERS, int action) if (CMD_OPTION_SET('n')) { brk_info->original_lineno = strtol(CMD_OPTION_CHAR('n'), NULL, 10); brk_info->resolved_lineno = brk_info->original_lineno; - brk_info->resolved_span.start = XDEBUG_RESOLVED_SPAN_MIN; - brk_info->resolved_span.end = XDEBUG_RESOLVED_SPAN_MAX; } if (CMD_OPTION_SET('h')) { brk_info->hit_value = strtol(CMD_OPTION_CHAR('h'), NULL, 10); @@ -861,8 +859,6 @@ DBGP_FUNC(breakpoint_set) brk_info->file_len = 0; brk_info->original_lineno = 0; brk_info->resolved_lineno = 0; - brk_info->resolved_span.start = XDEBUG_RESOLVED_SPAN_MIN; - brk_info->resolved_span.end = XDEBUG_RESOLVED_SPAN_MAX; brk_info->classname = NULL; brk_info->functionname = NULL; brk_info->function_break_type = 0; @@ -911,8 +907,6 @@ DBGP_FUNC(breakpoint_set) } brk_info->original_lineno = strtol(CMD_OPTION_CHAR('n'), NULL, 10); brk_info->resolved_lineno = brk_info->original_lineno; - brk_info->resolved_span.start = XDEBUG_RESOLVED_SPAN_MIN; - brk_info->resolved_span.end = XDEBUG_RESOLVED_SPAN_MAX; /* If no filename is given, we use the current one */ if (!CMD_OPTION_SET('f')) { @@ -953,10 +947,10 @@ DBGP_FUNC(breakpoint_set) xdebug_llist_insert_next(context->line_breakpoints, XDEBUG_LLIST_TAIL(context->line_breakpoints), (void*) brk_info); if (XG_DBG(context).resolved_breakpoints) { - function_stack_entry *fse = xdebug_get_stack_tail(); + xdebug_lines_list *lines_list; - if (fse) { - line_breakpoint_resolve_helper(context, fse, brk_info); + if (xdebug_hash_find(XG_DBG(breakable_lines_map), brk_info->file, brk_info->file_len, (void *) &lines_list)) { + line_breakpoint_resolve_helper(context, lines_list, brk_info); } } } else @@ -999,6 +993,8 @@ DBGP_FUNC(breakpoint_set) } } } + + brk_info->resolved = XDEBUG_BRK_RESOLVED; } else if (strcmp(CMD_OPTION_CHAR('t'), "exception") == 0) { @@ -1011,6 +1007,8 @@ DBGP_FUNC(breakpoint_set) } else { brk_info->id = breakpoint_admin_add(context, XDEBUG_BREAKPOINT_TYPE_EXCEPTION, CMD_OPTION_CHAR('x')); } + + brk_info->resolved = XDEBUG_BRK_RESOLVED; } else if (strcmp(CMD_OPTION_CHAR('t'), "watch") == 0) { @@ -2674,31 +2672,14 @@ int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, return xdebug_is_debug_connection_active_for_current_pid(); } -static xdebug_set *get_executable_lines_from_oparray(function_stack_entry *fse) -{ - int i; - zend_op_array *opa = fse->op_array; - xdebug_set *tmp; - - if (fse->executable_lines_cache) { - return fse->executable_lines_cache; - } - - tmp = xdebug_set_create(opa->line_end); - - for (i = 0; i < opa->last; i++ ) { - if (opa->opcodes[i].opcode == ZEND_EXT_STMT ) { - xdebug_set_add(tmp, opa->opcodes[i].lineno); - } - } - - return tmp; -} - static int xdebug_dbgp_resolved_breakpoint_notification(xdebug_con *context, xdebug_brk_info *brk_info) { xdebug_xml_node *response, *child; + if (!context->send_notifications) { + return 0; + } + response = xdebug_xml_node_init("notify"); xdebug_xml_add_attribute(response, "xmlns", "urn:debugger_protocol_v1"); xdebug_xml_add_attribute(response, "xmlns:xdebug", "https://xdebug.org/dbgp/xdebug"); @@ -2714,17 +2695,7 @@ static int xdebug_dbgp_resolved_breakpoint_notification(xdebug_con *context, xde return 1; } -inline static int function_span_is_smaller_than_resolved_span(zend_op_array *opa, xdebug_brk_span *span) -{ - if ( - (opa->line_start >= span->start && opa->line_end < span->end) || - (opa->line_start > span->start && opa->line_end <= span->end) - ) { - return 1; - } - return 0; -} - +/* static void function_breakpoint_resolve_helper(void *rctxt, xdebug_brk_info *brk_info, xdebug_hash_element *he) { xdebug_dbgp_resolve_context *ctxt = (xdebug_dbgp_resolve_context*) rctxt; @@ -2768,83 +2739,42 @@ static void function_breakpoint_resolve_helper(void *rctxt, xdebug_brk_info *brk return; } } +*/ -static void line_breakpoint_resolve_helper(xdebug_con *context, function_stack_entry *fse, xdebug_brk_info *brk_info) +static void line_breakpoint_resolve_helper(xdebug_con *context, xdebug_lines_list *lines_list, xdebug_brk_info *brk_info) { - /* If the breakpoint's line number isn't in the function's range, bail out */ - if (brk_info->original_lineno < fse->op_array->line_start || brk_info->original_lineno > fse->op_array->line_end) { - context->handler->log(XDEBUG_LOG_DEBUG, "R: Line number (%d) out of range (%d-%d)\n", brk_info->original_lineno, fse->op_array->line_start, fse->op_array->line_end); - return; - } - - /* If we have resolved before, we only resolve again if the current scope's - * line-span is *smaller* then the one that was used for the already - * resolved case */ - if (brk_info->resolved == XDEBUG_BRK_RESOLVED && !function_span_is_smaller_than_resolved_span(fse->op_array, &brk_info->resolved_span)) { - context->handler->log(XDEBUG_LOG_DEBUG, "R: Resolved span (%ld-%ld) is not smaller than function span (%u-%u)\n", brk_info->resolved_span.start, brk_info->resolved_span.end, fse->op_array->line_start, fse->op_array->line_end); - return; - } else if (brk_info->resolved != XDEBUG_BRK_RESOLVED) { - context->handler->log(XDEBUG_LOG_DEBUG, "I: Has not been resolved yet\n"); - } else { - context->handler->log(XDEBUG_LOG_DEBUG, "I: Resolved span (%ld-%ld) is smaller than function span (%u-%u)\n", brk_info->resolved_span.start, brk_info->resolved_span.end, fse->op_array->line_start, fse->op_array->line_end); - } - - /* If we're not in a normal function or method: */ - if (XDEBUG_IS_NORMAL_FUNCTION(&fse->function)) { - context->handler->log(XDEBUG_LOG_DEBUG, "I: '%s' is a normal function or method (%02x)\n", fse->function.function, fse->function.type); - - /* If the 'line' breakpoint's file and current file don't match, bail out */ - if (strcmp(brk_info->file, STR_NAME_VAL(fse->op_array->filename)) != 0) { - context->handler->log(XDEBUG_LOG_DEBUG, "R: Breakpoint file name (%s) does not match function's file name (%s)\n", brk_info->file, STR_NAME_VAL(fse->op_array->filename)); - return; - } - } - /* else, if we're in an eval: */ - else if (fse->function.type == XFUNC_EVAL) { - char *key, *dbgp_eval_key; - xdebug_eval_info *ei; +// xdebug_func func; + int i; + xdebug_function_lines_map_item *found_item = NULL; + int found_item_span = XDEBUG_RESOLVED_SPAN_MAX; - context->handler->log(XDEBUG_LOG_DEBUG, "I: Current 'function' is an eval statement\n"); + /* Loop over all definitions in lines_list for file */ + for (i = 0; i < lines_list->count; i++) { + xdebug_function_lines_map_item *item = lines_list->functions[i]; - key = create_eval_key_file(fse->filename, fse->lineno); - context->handler->log(XDEBUG_LOG_DEBUG, " I: Looking up eval ID for '%s'\n", key); - if (!xdebug_hash_find(context->eval_id_lookup, key, strlen(key), (void *) &ei)) { - context->handler->log(XDEBUG_LOG_DEBUG, " R: Eval ID not found\n"); - xdfree(key); - return; + /* Loop over all the file/line list entries to find the best fitting one for 'brk_info->original_lineno' */ + if (brk_info->original_lineno < item->line_start || brk_info->original_lineno > item->line_end) { + context->handler->log(XDEBUG_LOG_DEBUG, "R: Line number (%d) out of range (%zd-%zd)\n", brk_info->original_lineno, item->line_start, item->line_end); + continue; } - xdfree(key); - context->handler->log(XDEBUG_LOG_DEBUG, " I: Constructing 'filename' for eval ID '%d'\n", ei->id); - dbgp_eval_key = xdebug_sprintf("dbgp://%d", ei->id); - - if (strcmp(dbgp_eval_key, brk_info->file) != 0) { - context->handler->log(XDEBUG_LOG_DEBUG, " R: Breakpoint file name (%s) does not match eval's file name (%s)\n", brk_info->file, dbgp_eval_key); - xdfree(dbgp_eval_key); - return; + if (item->line_span < found_item_span) { + found_item = item; + found_item_span = item->line_span; } - xdfree(dbgp_eval_key); } - /* else, if we're an include or require: */ - else if (fse->function.type & XFUNC_INCLUDES) { - context->handler->log(XDEBUG_LOG_DEBUG, "I: Current 'function' is a file scope (%s)\n", STR_NAME_VAL(fse->op_array->filename)); - /* If the 'line' breakpoint's file and current file don't match, bail out */ - if (strcmp(brk_info->file, STR_NAME_VAL(fse->op_array->filename)) != 0) { - context->handler->log(XDEBUG_LOG_DEBUG, " R: Breakpoint file name (%s) does not match file's name (%s)\n", brk_info->file, STR_NAME_VAL(fse->op_array->filename)); - return; - } - } else { - context->handler->log(XDEBUG_LOG_DEBUG, "R: We don't handle this function type (%02x) yet\n", fse->function.type); + if (!found_item) { + context->handler->log(XDEBUG_LOG_DEBUG, "R: Could not find any file/line entry in lines list\n"); return; } + context->handler->log(XDEBUG_LOG_DEBUG, "R: Line number (%d) in smallest range of range (%zd-%zd)\n", brk_info->original_lineno, found_item->line_start, found_item->line_end); + /* If the breakpoint's line number is in the set, mark as resolved */ - if (xdebug_set_in(get_executable_lines_from_oparray(fse), brk_info->original_lineno)) { + if (xdebug_set_in(found_item->lines_breakable, brk_info->original_lineno)) { context->handler->log(XDEBUG_LOG_DEBUG, "F: Breakpoint line (%d) found in set of executable lines\n", brk_info->original_lineno); brk_info->resolved_lineno = brk_info->original_lineno; - brk_info->resolved_span.start = fse->op_array->line_start; - brk_info->resolved_span.end = fse->op_array->line_end; brk_info->resolved = XDEBUG_BRK_RESOLVED; xdebug_dbgp_resolved_breakpoint_notification(context, brk_info); return; @@ -2858,60 +2788,37 @@ static void line_breakpoint_resolve_helper(xdebug_con *context, function_stack_e do { tmp_lineno++; - if (xdebug_set_in(get_executable_lines_from_oparray(fse), tmp_lineno)) { - context->handler->log(XDEBUG_LOG_DEBUG, " F: Line (%d) in set (with span: %d-%d)\n", tmp_lineno, fse->op_array->line_start, fse->op_array->line_end); + if (xdebug_set_in(found_item->lines_breakable, tmp_lineno)) { + context->handler->log(XDEBUG_LOG_DEBUG, " F: Line (%d) in set\n", tmp_lineno); brk_info->resolved_lineno = tmp_lineno; - brk_info->resolved_span.start = fse->op_array->line_start; - brk_info->resolved_span.end = fse->op_array->line_end; brk_info->resolved = XDEBUG_BRK_RESOLVED; xdebug_dbgp_resolved_breakpoint_notification(context, brk_info); return; } else { context->handler->log(XDEBUG_LOG_DEBUG, " I: Line (%d) not in set\n", tmp_lineno); } - } while (tmp_lineno < fse->op_array->line_end && (tmp_lineno < brk_info->original_lineno + XDEBUG_DBGP_SCAN_RANGE)); + } while (tmp_lineno < found_item->line_end && (tmp_lineno < brk_info->original_lineno + XDEBUG_DBGP_SCAN_RANGE)); /* Check for a previous line in the function */ tmp_lineno = brk_info->original_lineno; do { tmp_lineno--; - if (xdebug_set_in(get_executable_lines_from_oparray(fse), tmp_lineno)) { + if (xdebug_set_in(found_item->lines_breakable, tmp_lineno)) { context->handler->log(XDEBUG_LOG_DEBUG, " F: Line (%d) in set\n", tmp_lineno); brk_info->resolved_lineno = tmp_lineno; - brk_info->resolved_span.start = fse->op_array->line_start; - brk_info->resolved_span.end = fse->op_array->line_end; brk_info->resolved = XDEBUG_BRK_RESOLVED; xdebug_dbgp_resolved_breakpoint_notification(context, brk_info); return; } else { context->handler->log(XDEBUG_LOG_DEBUG, " I: Line (%d) not in set\n", tmp_lineno); } - } while (tmp_lineno > fse->op_array->line_start && (tmp_lineno > brk_info->original_lineno - XDEBUG_DBGP_SCAN_RANGE)); + } while (tmp_lineno > found_item->line_start && (tmp_lineno > brk_info->original_lineno - XDEBUG_DBGP_SCAN_RANGE)); } } -static void exception_breakpoint_resolve_helper(xdebug_con *context, xdebug_brk_info *brk_info) -{ - if (brk_info->resolved == XDEBUG_BRK_RESOLVED) { - context->handler->log(XDEBUG_LOG_DEBUG, "R: %s breakpoint for '%s' has already been resolved\n", XDEBUG_BREAKPOINT_TYPE_NAME(brk_info->brk_type), brk_info->exceptionname); - return; - } - - if (strcmp("*", brk_info->exceptionname) == 0) { - context->handler->log(XDEBUG_LOG_DEBUG, "F: Breakpoint exception (%s) matches every exception\n", brk_info->exceptionname); - brk_info->resolved = XDEBUG_BRK_RESOLVED; - xdebug_dbgp_resolved_breakpoint_notification(context, brk_info); - return; - } - - context->handler->log(XDEBUG_LOG_DEBUG, "F: Breakpoint exception (%s) matches\n", brk_info->exceptionname); - brk_info->resolved = XDEBUG_BRK_RESOLVED; - xdebug_dbgp_resolved_breakpoint_notification(context, brk_info); -} - static void breakpoint_resolve_helper(void *rctxt, xdebug_hash_element *he) { xdebug_dbgp_resolve_context *ctxt = (xdebug_dbgp_resolve_context*) rctxt; @@ -2919,54 +2826,57 @@ static void breakpoint_resolve_helper(void *rctxt, xdebug_hash_element *he) xdebug_brk_info *brk_info; brk_info = breakpoint_brk_info_fetch(admin->type, admin->key); - - /* This helper doesn't deal with XDEBUG_BREAKPOINT_TYPE_EXCEPTION, and hence this condition should never match */ - if (brk_info->brk_type == XDEBUG_BREAKPOINT_TYPE_EXCEPTION) { - ctxt->context->handler->log(XDEBUG_LOG_ERR, "E: Not a user defined function (%s)\n", ctxt->fse->function.function); - } - + ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "Breakpoint %d (type: %s)\n", admin->id, XDEBUG_BREAKPOINT_TYPE_NAME(brk_info->brk_type)); - if (! (brk_info->brk_type & ctxt->breakpoint_type_set)) { - ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "R: Breakpoint type '%s' did not match requested set '%02x'\n", XDEBUG_BREAKPOINT_TYPE_NAME(brk_info->brk_type), ctxt->breakpoint_type_set); - return; - } - /* If we're not in a user defined function or method, bail out */ - if (ctxt->fse->user_defined != XDEBUG_USER_DEFINED) { - ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "R: Not a user defined function (%s)\n", ctxt->fse->function.function); + /* Bail early if it's already resolved */ + if (brk_info->resolved == XDEBUG_BRK_RESOLVED) { + ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "D: Breakpoint %d (type: %s) is already resolved\n", admin->id, XDEBUG_BREAKPOINT_TYPE_NAME(brk_info->brk_type)); return; } switch (brk_info->brk_type) { case XDEBUG_BREAKPOINT_TYPE_LINE: case XDEBUG_BREAKPOINT_TYPE_CONDITIONAL: - line_breakpoint_resolve_helper(ctxt->context, ctxt->fse, brk_info); - return; + if (brk_info->file_len != ZSTR_LEN(ctxt->filename)) { + ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "R: File name length (%zd) does not match breakpoint to resolve (%d)\n", ZSTR_LEN(ctxt->filename), brk_info->file_len); + return; + } + if (strcmp(brk_info->file, ZSTR_VAL(ctxt->filename)) != 0) { + ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "R: File name (%s) does not match breakpoint to resolve (%s)\n", ZSTR_VAL(ctxt->filename), brk_info->file); + return; + } + line_breakpoint_resolve_helper(ctxt->context, ctxt->lines_list, brk_info); + return; +/* case XDEBUG_BREAKPOINT_TYPE_CALL: case XDEBUG_BREAKPOINT_TYPE_RETURN: function_breakpoint_resolve_helper(rctxt, brk_info, he); return; - +*/ default: ctxt->context->handler->log(XDEBUG_LOG_DEBUG, "R: The breakpoint type '%s' can not be resolved\n", XDEBUG_BREAKPOINT_TYPE_NAME(brk_info->brk_type)); return; } } -int xdebug_dbgp_resolve_breakpoints(xdebug_con *context, int breakpoint_type_set, void *data) +/* Fetches the lines list for 'filename', and loops over all breakpoints to try + * to resolve them at run-time */ +int xdebug_dbgp_resolve_breakpoints(xdebug_con *context, zend_string *filename) { xdebug_dbgp_resolve_context resolv_ctxt; + xdebug_lines_list *lines_list; - if (XDEBUG_BREAKPOINT_TYPE_EXCEPTION & breakpoint_type_set) { - exception_breakpoint_resolve_helper(context, (xdebug_brk_info*) data); - return 1; + /* Get the lines list for the current file */ + if (!xdebug_hash_find(XG_DBG(breakable_lines_map), ZSTR_VAL(filename), ZSTR_LEN(filename), (void *) &lines_list)) { + context->handler->log(XDEBUG_LOG_DEBUG, "E: Lines list for '%s' does not exist\n", ZSTR_VAL(filename)); + return 0; } resolv_ctxt.context = context; - resolv_ctxt.breakpoint_type_set = breakpoint_type_set; - resolv_ctxt.fse = (function_stack_entry *) data; - resolv_ctxt.executable_lines = get_executable_lines_from_oparray(resolv_ctxt.fse); + resolv_ctxt.filename = filename; + resolv_ctxt.lines_list = lines_list; xdebug_hash_apply(context->breakpoint_list, (void *) &resolv_ctxt, breakpoint_resolve_helper); return 1; diff --git a/src/debugger/handler_dbgp.h b/src/debugger/handler_dbgp.h index 606e0ef6f..952e0b0cf 100644 --- a/src/debugger/handler_dbgp.h +++ b/src/debugger/handler_dbgp.h @@ -88,10 +88,8 @@ typedef struct xdebug_dbgp_cmd { typedef struct xdebug_dbgp_resolve_context { xdebug_con *context; - int breakpoint_type_set; - function_stack_entry *fse; - zend_class_entry *exception_ce; - xdebug_set *executable_lines; + zend_string *filename; + xdebug_lines_list *lines_list; } xdebug_dbgp_resolve_context; #define CMD_OPTION_SET(opt) (!!(opt == '-' ? args->value[26] : args->value[(opt) - 'a'])) @@ -104,7 +102,7 @@ int xdebug_dbgp_deinit(xdebug_con *context); int xdebug_dbgp_error(xdebug_con *context, int type, char *exception_type, char *message, const char *location, const unsigned int line, xdebug_llist *stack); int xdebug_dbgp_break_on_line(xdebug_con *context, xdebug_brk_info *brk, const char *file, int file_len, int lineno); int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *code, char *message); -int xdebug_dbgp_resolve_breakpoints(xdebug_con *context, int type, void *data); +int xdebug_dbgp_resolve_breakpoints(xdebug_con *context, zend_string *filename); int xdebug_dbgp_stream_output(const char *string, unsigned int length); int xdebug_dbgp_notification(xdebug_con *context, const char *file, long lineno, int type, char *type_string, char *message); void XDEBUG_ATTRIBUTE_FORMAT(printf, 2, 3) xdebug_dbgp_log(int log_level, const char *fmt, ...); diff --git a/src/debugger/handlers.h b/src/debugger/handlers.h index f9d556125..a79926216 100644 --- a/src/debugger/handlers.h +++ b/src/debugger/handlers.h @@ -92,13 +92,7 @@ struct _xdebug_con { #define XDEBUG_HIT_EQUAL 2 #define XDEBUG_HIT_MOD 3 -#define XDEBUG_RESOLVED_SPAN_MIN -1 -#define XDEBUG_RESOLVED_SPAN_MAX 4294967295 - -struct _xdebug_brk_span { - long start; - long end; -}; +#define XDEBUG_RESOLVED_SPAN_MAX 2147483647 struct _xdebug_brk_info { int id; @@ -112,7 +106,6 @@ struct _xdebug_brk_info { int file_len; int original_lineno; /* line number that was set through breakpoint_set */ int resolved_lineno; /* line number after resolving, initialised with 'original_lineno' */ - xdebug_brk_span resolved_span; char *condition; int disabled; int temporary; @@ -138,7 +131,7 @@ struct _xdebug_remote_handler { /* Breakpoints */ int (*break_on_line)(xdebug_con *h, xdebug_brk_info *brk, const char *file, int filename_len, int lineno); int (*remote_breakpoint)(xdebug_con *h, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *code, char *message); - int (*resolve_breakpoints)(xdebug_con *h, int type, void *data); + int (*resolve_breakpoints)(xdebug_con *h, zend_string *opa); /* Output redirection */ int (*remote_stream_output)(const char *string, unsigned int length); diff --git a/src/lib/private.h b/src/lib/private.h index 30093179e..d81a508f8 100644 --- a/src/lib/private.h +++ b/src/lib/private.h @@ -165,7 +165,6 @@ typedef struct _function_stack_entry { /* function properties */ xdebug_func function; int user_defined; - xdebug_set *executable_lines_cache; /* location properties */ unsigned int level; diff --git a/tests/debugger/bug00842-php7-001.phpt b/tests/debugger/bug00842-php7-001.phpt index 342ecf1d2..0a3897bee 100644 --- a/tests/debugger/bug00842-php7-001.phpt +++ b/tests/debugger/bug00842-php7-001.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug00842.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 14", "breakpoint_set -t line -f file://{$filename} -n 17", @@ -31,56 +32,60 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug00842.inc -n 14 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -f file://bug00842.inc -n 17 +-> breakpoint_set -i 3 -t line -f file://bug00842.inc -n 14 - + --> run -i 4 - + +-> breakpoint_set -i 4 -t line -f file://bug00842.inc -n 17 - + - + --> stack_get -i 5 +-> run -i 5 - + --> step_into -i 6 +-> stack_get -i 6 - + -> step_into -i 7 - + --> stack_get -i 8 +-> step_into -i 8 - + --> step_into -i 9 +-> stack_get -i 9 - + -> step_into -i 10 - + --> stack_get -i 11 +-> step_into -i 11 - + --> detach -i 12 +-> stack_get -i 12 - + + +-> detach -i 13 + + diff --git a/tests/debugger/bug00842-php7-004.phpt b/tests/debugger/bug00842-php7-004.phpt index ae47cc542..738d7af38 100644 --- a/tests/debugger/bug00842-php7-004.phpt +++ b/tests/debugger/bug00842-php7-004.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug00842.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 18", 'run', @@ -26,33 +27,37 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug00842.inc -n 18 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug00842.inc -n 18 - + --> step_into -i 4 +-> run -i 4 - + --> step_out -i 5 +-> step_into -i 5 - + --> step_into -i 6 +-> step_out -i 6 - + --> detach -i 7 +-> step_into -i 7 - + + +-> detach -i 8 + + diff --git a/tests/debugger/bug01335.phpt b/tests/debugger/bug01335.phpt index 4562ce98e..6c13557b4 100644 --- a/tests/debugger/bug01335.phpt +++ b/tests/debugger/bug01335.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01335.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 39", 'run', @@ -28,41 +29,45 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01335.inc -n 39 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01335.inc -n 39 - + --> context_get -i 4 +-> run -i 4 - + --> property_get -i 5 -d 0 -c 0 -n $b +-> context_get -i 5 - + --> property_get -i 6 -d 0 -c 0 -n $b->*TestA\TestB\TestC\A*data1 +-> property_get -i 6 -d 0 -c 0 -n $b - + --> property_get -i 7 -d 0 -c 0 -n $b->*TestA\TestB\TestC\A*data1->items +-> property_get -i 7 -d 0 -c 0 -n $b->*TestA\TestB\TestC\A*data1 - + --> property_get -i 8 -d 0 -c 0 -n "$b->*TestA\\TestB\\TestC\\A*data1" +-> property_get -i 8 -d 0 -c 0 -n $b->*TestA\TestB\TestC\A*data1->items - + --> property_get -i 9 -d 0 -c 0 -n "$b->*TestA\\TestB\\TestC\\A*data1->items" +-> property_get -i 9 -d 0 -c 0 -n "$b->*TestA\\TestB\\TestC\\A*data1" - + + +-> property_get -i 10 -d 0 -c 0 -n "$b->*TestA\\TestB\\TestC\\A*data1->items" + + diff --git a/tests/debugger/bug01388-01.phpt b/tests/debugger/bug01388-01.phpt index 46215fe08..245f654a0 100644 --- a/tests/debugger/bug01388-01.phpt +++ b/tests/debugger/bug01388-01.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-01.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_get -n resolved_breakpoints', "breakpoint_set -t line -f file://{$filename} -n 4", 'breakpoint_list', @@ -28,38 +29,45 @@ dbgpRunFile( $filename, $commands ); --> feature_get -i 1 -n resolved_breakpoints +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-01.inc -n 4 +-> feature_get -i 2 -n resolved_breakpoints - + --> breakpoint_list -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-01.inc -n 4 - + --> feature_set -i 4 -n resolved_breakpoints -v 1 +-> breakpoint_list -i 4 - + --> feature_get -i 5 -n resolved_breakpoints +-> feature_set -i 5 -n resolved_breakpoints -v 1 - + --> breakpoint_list -i 6 +-> feature_get -i 6 -n resolved_breakpoints - + --> breakpoint_set -i 7 -t line -f file://bug01388-01.inc -n 4 +-> breakpoint_list -i 7 - + --> breakpoint_list -i 8 +-> breakpoint_set -i 8 -t line -f file://bug01388-01.inc -n 4 - + --> detach -i 9 - + + +-> breakpoint_list -i 9 + + + +-> detach -i 10 + + diff --git a/tests/debugger/bug01388-02-php70.phpt b/tests/debugger/bug01388-02-php70.phpt index 32eb0de5a..97ebc31d7 100644 --- a/tests/debugger/bug01388-02-php70.phpt +++ b/tests/debugger/bug01388-02-php70.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-02.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', 'breakpoint_set -t line -n 4', @@ -24,28 +25,29 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -n 4 +-> step_into -i 3 - + +-> breakpoint_set -i 4 -t line -n 4 - + --> run -i 4 - + +-> run -i 5 - + --> detach -i 5 +-> detach -i 6 - + diff --git a/tests/debugger/bug01388-02-php74.phpt b/tests/debugger/bug01388-02-php74.phpt index 39794d62f..2a39a1422 100644 --- a/tests/debugger/bug01388-02-php74.phpt +++ b/tests/debugger/bug01388-02-php74.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-02.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', 'breakpoint_set -t line -n 4', @@ -24,25 +25,29 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -n 4 +-> step_into -i 3 - + --> run -i 4 +-> breakpoint_set -i 4 -t line -n 4 - + --> detach -i 5 +-> run -i 5 - + + +-> detach -i 6 + + diff --git a/tests/debugger/bug01388-03-php70.phpt b/tests/debugger/bug01388-03-php70.phpt index 7219b03ee..725bf89c3 100644 --- a/tests/debugger/bug01388-03-php70.phpt +++ b/tests/debugger/bug01388-03-php70.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-03.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', 'breakpoint_set -t line -n 5', @@ -26,39 +27,40 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -n 5 +-> step_into -i 3 - + +-> breakpoint_set -i 4 -t line -n 5 - + --> breakpoint_set -i 4 -t line -n 13 - + --> run -i 5 +-> breakpoint_set -i 5 -t line -n 13 - + - + -> run -i 6 - + +-> run -i 7 - + --> detach -i 7 +-> detach -i 8 - + diff --git a/tests/debugger/bug01388-03-php74.phpt b/tests/debugger/bug01388-03-php74.phpt index 7da1d3d06..c2502d41d 100644 --- a/tests/debugger/bug01388-03-php74.phpt +++ b/tests/debugger/bug01388-03-php74.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-03.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', 'breakpoint_set -t line -n 5', @@ -26,36 +27,40 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -n 5 +-> step_into -i 3 - + --> breakpoint_set -i 4 -t line -n 13 +-> breakpoint_set -i 4 -t line -n 5 - + --> run -i 5 - + + +-> breakpoint_set -i 5 -t line -n 13 + + - + -> run -i 6 - + +-> run -i 7 - + --> detach -i 7 +-> detach -i 8 - + diff --git a/tests/debugger/bug01388-04.phpt b/tests/debugger/bug01388-04.phpt index c55281548..f3e39844b 100644 --- a/tests/debugger/bug01388-04.phpt +++ b/tests/debugger/bug01388-04.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-04.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 2", 'run', @@ -23,21 +24,25 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-04.inc -n 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-04.inc -n 2 - + --> detach -i 4 +-> run -i 4 - + + +-> detach -i 5 + + diff --git a/tests/debugger/bug01388-05.phpt b/tests/debugger/bug01388-05.phpt index d859400db..2ff257042 100644 --- a/tests/debugger/bug01388-05.phpt +++ b/tests/debugger/bug01388-05.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-05.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 2", 'run', @@ -23,21 +24,25 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-05.inc -n 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-05.inc -n 2 - + --> detach -i 4 +-> run -i 4 - + + +-> detach -i 5 + + diff --git a/tests/debugger/bug01388-06.phpt b/tests/debugger/bug01388-06.phpt index 9c4eb9a20..158501998 100644 --- a/tests/debugger/bug01388-06.phpt +++ b/tests/debugger/bug01388-06.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-06.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 2", 'run', @@ -23,21 +24,25 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-06.inc -n 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-06.inc -n 2 - + --> detach -i 4 +-> run -i 4 - + + +-> detach -i 5 + + diff --git a/tests/debugger/bug01388-07.phpt b/tests/debugger/bug01388-07.phpt index 2e9eb81ae..a158dd161 100644 --- a/tests/debugger/bug01388-07.phpt +++ b/tests/debugger/bug01388-07.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-07.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 1", "breakpoint_set -t line -f file://{$filename} -n 3", @@ -29,54 +30,58 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-07.inc -n 1 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -f file://bug01388-07.inc -n 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-07.inc -n 1 - + --> breakpoint_set -i 4 -t line -f file://bug01388-07.inc -n 5 - + --> breakpoint_set -i 5 -t line -f file://bug01388-07.inc -n 6 +-> breakpoint_set -i 4 -t line -f file://bug01388-07.inc -n 3 - + --> run -i 6 - + +-> breakpoint_set -i 5 -t line -f file://bug01388-07.inc -n 5 - + - + +-> breakpoint_set -i 6 -t line -f file://bug01388-07.inc -n 6 - + - + -> run -i 7 - + -> run -i 8 - + -> run -i 9 - + --> detach -i 10 +-> run -i 10 - + + +-> detach -i 11 + + diff --git a/tests/debugger/bug01388-08-php70.phpt b/tests/debugger/bug01388-08-php70.phpt index 9c13e5383..ded209b44 100644 --- a/tests/debugger/bug01388-08-php70.phpt +++ b/tests/debugger/bug01388-08-php70.phpt @@ -19,7 +19,6 @@ $commands = array( 'step_into', 'step_into', 'run', - 'run', 'detach', ); @@ -51,25 +50,18 @@ dbgpRunFile( $filename, $commands ); -> step_into -i 6 - + - + -> run -i 7 - - --> run -i 8 - - - - - + --> detach -i 9 +-> detach -i 8 - + diff --git a/tests/debugger/bug01388-08-php74.phpt b/tests/debugger/bug01388-08-php74.phpt index e6771804b..8fb2ff045 100644 --- a/tests/debugger/bug01388-08-php74.phpt +++ b/tests/debugger/bug01388-08-php74.phpt @@ -50,15 +50,15 @@ dbgpRunFile( $filename, $commands ); -> run -i 6 - + - + --> run -i 7 - + +-> run -i 7 diff --git a/tests/debugger/bug01388-09.phpt b/tests/debugger/bug01388-09.phpt index 968567e86..a6e77cd01 100644 --- a/tests/debugger/bug01388-09.phpt +++ b/tests/debugger/bug01388-09.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-09.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 4", 'step_into', @@ -27,40 +28,41 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-09.inc -n 4 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> step_into -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-09.inc -n 4 - + - + -> step_into -i 4 - + -> step_into -i 5 - + +-> step_into -i 6 - + --> stack_get -i 6 +-> stack_get -i 7 - + --> step_into -i 7 +-> step_into -i 8 - + --> detach -i 8 +-> detach -i 9 - + diff --git a/tests/debugger/bug01388-10-php70.phpt b/tests/debugger/bug01388-10-php70.phpt index 29f0df35f..36c8139ba 100644 --- a/tests/debugger/bug01388-10-php70.phpt +++ b/tests/debugger/bug01388-10-php70.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-10.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 6", 'step_into', @@ -29,51 +30,49 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-10.inc -n 6 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> step_into -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-10.inc -n 6 - + - + -> step_into -i 4 - + -> step_into -i 5 - - - - + --> stack_get -i 6 +-> step_into -i 6 - + --> step_into -i 7 +-> stack_get -i 7 - + -> step_into -i 8 - + +-> step_into -i 9 - + --> step_into -i 9 +-> step_into -i 10 - + --> detach -i 10 +-> detach -i 11 - + diff --git a/tests/debugger/bug01388-10-php74.phpt b/tests/debugger/bug01388-10-php74.phpt index 7125f99b5..01e70bf36 100644 --- a/tests/debugger/bug01388-10-php74.phpt +++ b/tests/debugger/bug01388-10-php74.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-10.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 6", 'step_into', @@ -28,44 +29,45 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-10.inc -n 6 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> step_into -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-10.inc -n 6 - + --> step_into -i 4 - + +-> step_into -i 4 - + --> stack_get -i 5 +-> step_into -i 5 - + --> step_into -i 6 +-> stack_get -i 6 - + -> step_into -i 7 - + +-> step_into -i 8 - + --> step_into -i 8 +-> step_into -i 9 - + --> detach -i 9 +-> detach -i 10 - + diff --git a/tests/debugger/bug01388-11-php70.phpt b/tests/debugger/bug01388-11-php70.phpt index 7bb87766c..d1c4bac52 100644 --- a/tests/debugger/bug01388-11-php70.phpt +++ b/tests/debugger/bug01388-11-php70.phpt @@ -11,11 +11,11 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-10.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 6", 'run', 'run', - 'run', 'detach', ); @@ -25,32 +25,26 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-10.inc -n 6 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-10.inc -n 6 - + - + -> run -i 4 - - - - + -> run -i 5 - - - diff --git a/tests/debugger/bug01388-11-php74.phpt b/tests/debugger/bug01388-11-php74.phpt index 27e249486..3f6916b41 100644 --- a/tests/debugger/bug01388-11-php74.phpt +++ b/tests/debugger/bug01388-11-php74.phpt @@ -11,11 +11,11 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-10.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f file://{$filename} -n 6", 'run', 'run', - 'run', 'detach', ); @@ -25,25 +25,22 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f file://bug01388-10.inc -n 6 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f file://bug01388-10.inc -n 6 - + - + -> run -i 4 - - - diff --git a/tests/debugger/bug01388-12.phpt b/tests/debugger/bug01388-12.phpt index 961477692..74c4c8bce 100644 --- a/tests/debugger/bug01388-12.phpt +++ b/tests/debugger/bug01388-12.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-12.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -t line -f dbgp://1 -n 2", 'run', @@ -23,21 +24,25 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t line -f dbgp://1 -n 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t line -f dbgp://1 -n 2 - + +-> run -i 4 - + --> detach -i 4 - + + +-> detach -i 5 + + diff --git a/tests/debugger/bug01388-13-php70.phpt b/tests/debugger/bug01388-13-php70.phpt index 757ebf698..5a1030e28 100644 --- a/tests/debugger/bug01388-13-php70.phpt +++ b/tests/debugger/bug01388-13-php70.phpt @@ -15,6 +15,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-13.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -n 7 -f file://{$filename} -t conditional -- JG1vZHVsZSA9PSB2aWV3cw==", 'run', @@ -28,28 +29,29 @@ dbgpRunFile( $filename, $commands, [ 'track_errors' => 'Off' ] ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -n 7 -f file://bug01388-13.inc -t conditional -- JG1vZHVsZSA9PSB2aWV3cw== +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -n 7 -f file://bug01388-13.inc -t conditional -- JG1vZHVsZSA9PSB2aWV3cw== - + - + +-> run -i 4 - + --> context_get -i 4 +-> context_get -i 5 - + --> detach -i 5 +-> detach -i 6 - + diff --git a/tests/debugger/bug01388-13-php74.phpt b/tests/debugger/bug01388-13-php74.phpt index a20d2012d..c8ba7982f 100644 --- a/tests/debugger/bug01388-13-php74.phpt +++ b/tests/debugger/bug01388-13-php74.phpt @@ -15,6 +15,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-13.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', "breakpoint_set -n 7 -f file://{$filename} -t conditional -- JG1vZHVsZSA9PSB2aWV3cw==", 'run', @@ -28,25 +29,29 @@ dbgpRunFile( $filename, $commands, [ 'track_errors' => 'Off' ] ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -n 7 -f file://bug01388-13.inc -t conditional -- JG1vZHVsZSA9PSB2aWV3cw== +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -n 7 -f file://bug01388-13.inc -t conditional -- JG1vZHVsZSA9PSB2aWV3cw== - + --> context_get -i 4 +-> run -i 4 - + --> detach -i 5 +-> context_get -i 5 - + + +-> detach -i 6 + + diff --git a/tests/debugger/bug01388-14.phpt b/tests/debugger/bug01388-14.phpt index a4b61fb2e..b203509e8 100644 --- a/tests/debugger/bug01388-14.phpt +++ b/tests/debugger/bug01388-14.phpt @@ -15,6 +15,7 @@ putenv("XDEBUG_TEST_DIR=$dir"); $filename = realpath( dirname(__FILE__) . '/bug01388-14-index.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'breakpoint_set -t call -m SimpleClass::displayVar', 'run', @@ -30,33 +31,34 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t call -m SimpleClass::displayVar +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t call -m SimpleClass::displayVar - + +-> run -i 4 - + --> step_into -i 4 +-> step_into -i 5 - + --> step_into -i 5 +-> step_into -i 6 - + --> context_get -i 6 +-> context_get -i 7 - + --> property_get -i 7 -n ::hello +-> property_get -i 8 -n ::hello - + diff --git a/tests/debugger/bug01388-15.phpt b/tests/debugger/bug01388-15.phpt index c512a1acb..ddf655d4f 100644 --- a/tests/debugger/bug01388-15.phpt +++ b/tests/debugger/bug01388-15.phpt @@ -12,6 +12,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-15.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'breakpoint_set -t return -m test1', 'breakpoint_set -t return -m test_class::test2', @@ -33,63 +34,58 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t return -m test1 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t return -m test_class::test2 +-> breakpoint_set -i 3 -t return -m test1 - + --> breakpoint_set -i 4 -t return -m test_class::test3 +-> breakpoint_set -i 4 -t return -m test_class::test2 - + --> run -i 5 +-> breakpoint_set -i 5 -t return -m test_class::test3 - + +-> run -i 6 - + --> stack_get -i 6 +-> stack_get -i 7 - + --> context_get -i 7 +-> context_get -i 8 - + --> run -i 8 +-> run -i 9 - + +-> stack_get -i 10 - + --> stack_get -i 9 +-> context_get -i 11 - + --> context_get -i 10 +-> run -i 12 - + --> run -i 11 +-> stack_get -i 13 - + +-> context_get -i 14 - - --> stack_get -i 12 - - - --> context_get -i 13 - - + diff --git a/tests/debugger/bug01388-16.phpt b/tests/debugger/bug01388-16.phpt index 2671f1d52..206791bc0 100644 --- a/tests/debugger/bug01388-16.phpt +++ b/tests/debugger/bug01388-16.phpt @@ -12,6 +12,7 @@ require 'dbgp/dbgpclient.php'; $filename = realpath( dirname(__FILE__) . '/bug01388-16.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'breakpoint_set -t exception -x FooBarException', 'run', @@ -29,47 +30,42 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t exception -x FooBarException +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t exception -x FooBarException - + +-> run -i 4 - + --> breakpoint_set -i 4 -t exception -x FooException +-> breakpoint_set -i 5 -t exception -x FooException - - --> run -i 5 - - - - - + -> run -i 6 - + --> breakpoint_set -i 7 -t exception -x * +-> run -i 7 - + --> run -i 8 +-> breakpoint_set -i 8 -t exception -x * - + +-> run -i 9 - + --> detach -i 9 +-> detach -i 10 - + diff --git a/tests/debugger/bug01388-17.phpt b/tests/debugger/bug01388-17.phpt index 62591414b..d9c9cadc1 100644 --- a/tests/debugger/bug01388-17.phpt +++ b/tests/debugger/bug01388-17.phpt @@ -1,5 +1,5 @@ --TEST-- -Test for bug #1388: Resolved exception breakpoint with inherited breakpoint +Test for bug #1388: Resolved exception breakpoint with inherited exception --SKIPIF-- --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t exception -x Exception +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t exception -x FooException +-> breakpoint_set -i 3 -t exception -x Exception - + --> run -i 4 +-> breakpoint_set -i 4 -t exception -x FooException - + +-> run -i 5 - + --> detach -i 5 +-> detach -i 6 - + diff --git a/tests/debugger/bug01388-18.phpt b/tests/debugger/bug01388-18.phpt index 0ff2ef0c2..f28810470 100644 --- a/tests/debugger/bug01388-18.phpt +++ b/tests/debugger/bug01388-18.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-18.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', 'breakpoint_set -t line -n 2', @@ -24,25 +25,29 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -n 2 +-> step_into -i 3 + + + +-> breakpoint_set -i 4 -t line -n 2 - + --> run -i 4 +-> run -i 5 - + --> detach -i 5 +-> detach -i 6 - + diff --git a/tests/debugger/bug01388-19.phpt b/tests/debugger/bug01388-19.phpt index f773fead2..cdc342646 100644 --- a/tests/debugger/bug01388-19.phpt +++ b/tests/debugger/bug01388-19.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-19.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', "breakpoint_set -t line -f file://{$filename} -n 2", @@ -30,58 +31,62 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -f file://bug01388-19.inc -n 2 +-> step_into -i 3 + + + +-> breakpoint_set -i 4 -t line -f file://bug01388-19.inc -n 2 - + --> breakpoint_set -i 4 -t line -f file://bug01388-19.inc -n 4 +-> breakpoint_set -i 5 -t line -f file://bug01388-19.inc -n 4 - + --> breakpoint_set -i 5 -t line -f file://bug01388-19.inc -n 8 +-> breakpoint_set -i 6 -t line -f file://bug01388-19.inc -n 8 - + --> breakpoint_set -i 6 -t line -f file://bug01388-19.inc -n 9 +-> breakpoint_set -i 7 -t line -f file://bug01388-19.inc -n 9 - - --> run -i 7 - - + -> run -i 8 - + -> run -i 9 - + -> run -i 10 - + + +-> run -i 11 + + --> detach -i 11 +-> detach -i 12 - + diff --git a/tests/debugger/bug01388-20.phpt b/tests/debugger/bug01388-20.phpt index 3cef477ec..38acb4af7 100644 --- a/tests/debugger/bug01388-20.phpt +++ b/tests/debugger/bug01388-20.phpt @@ -11,6 +11,7 @@ require 'dbgp/dbgpclient.php'; $filename = dirname(__FILE__) . '/bug01388-20.inc'; $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'step_into', "breakpoint_set -t line -f file://{$filename} -n 3", @@ -23,21 +24,25 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> step_into -i 2 +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> breakpoint_set -i 3 -t line -f file://bug01388-20.inc -n 3 +-> step_into -i 3 + + + +-> breakpoint_set -i 4 -t line -f file://bug01388-20.inc -n 3 - + --> run -i 4 +-> run -i 5 - + diff --git a/tests/debugger/bug01388-21.phpt b/tests/debugger/bug01388-21.phpt index d61a0991f..f3cd30d6f 100644 --- a/tests/debugger/bug01388-21.phpt +++ b/tests/debugger/bug01388-21.phpt @@ -1,5 +1,5 @@ --TEST-- -Test for bug #1388: Resolved Breakpoint: attributes shown +Test for bug #1388: Resolved Breakpoint: without notify_ok --SKIPIF-- --EXPECTF-- - + --> step_into -i 1 +-> feature_set -i 1 -n resolved_breakpoints -v 1 - + --> feature_get -i 2 -n resolved_breakpoints +-> breakpoint_set -i 2 -t line -f file://bug01388-07.inc -n 1 - + --> breakpoint_set -i 3 -t line -f file://bug01388-01.inc -n 4 +-> breakpoint_set -i 3 -t line -f file://bug01388-07.inc -n 3 - + --> breakpoint_list -i 4 +-> breakpoint_set -i 4 -t line -f file://bug01388-07.inc -n 5 - + --> feature_set -i 5 -n resolved_breakpoints -v 1 +-> breakpoint_set -i 5 -t line -f file://bug01388-07.inc -n 6 - + --> feature_get -i 6 -n resolved_breakpoints +-> run -i 6 - + --> breakpoint_list -i 7 +-> run -i 7 - + --> breakpoint_set -i 8 -t line -f file://bug01388-01.inc -n 4 +-> run -i 8 - + +-> run -i 9 - - --> breakpoint_list -i 9 - - + -> detach -i 10 diff --git a/tests/debugger/bug01660.phpt b/tests/debugger/bug01660.phpt index bb036a189..af0516885 100644 --- a/tests/debugger/bug01660.phpt +++ b/tests/debugger/bug01660.phpt @@ -15,6 +15,7 @@ putenv("XDEBUG_TEST_DIR=$dir"); $filename = realpath( dirname(__FILE__) . '/bug01388-14-index.inc' ); $commands = array( + 'feature_set -n notify_ok -v 1', 'feature_set -n resolved_breakpoints -v 1', 'breakpoint_set -t return -m SimpleClass::displayVar', 'run', @@ -28,25 +29,26 @@ dbgpRunFile( $filename, $commands ); --> feature_set -i 1 -n resolved_breakpoints -v 1 +-> feature_set -i 1 -n notify_ok -v 1 - + --> breakpoint_set -i 2 -t return -m SimpleClass::displayVar +-> feature_set -i 2 -n resolved_breakpoints -v 1 - + --> run -i 3 +-> breakpoint_set -i 3 -t return -m SimpleClass::displayVar - + +-> run -i 4 - + --> context_get -i 4 +-> context_get -i 5 - + --> property_get -i 5 -n ::hello +-> property_get -i 6 -n ::hello - + diff --git a/tests/debugger/remote_log1.phpt b/tests/debugger/remote_log1.phpt index b29609379..7c02f3ffc 100644 --- a/tests/debugger/remote_log1.phpt +++ b/tests/debugger/remote_log1.phpt @@ -8,6 +8,7 @@ check_reqs('dbgp; !win'); --INI-- xdebug.remote_enable=1 xdebug.remote_log=/tmp/remote-log1.txt +xdebug.remote_log_level=20 xdebug.remote_autostart=1 xdebug.remote_connect_back=0 xdebug.remote_host=doesnotexist