mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: more work on phpdbg conditional breaks
This commit is contained in:
commit
fe7a914194
1 changed files with 33 additions and 0 deletions
|
@ -53,6 +53,7 @@ static inline void _phpdbg_break_mapping(int id, HashTable *table) /* {{{ */
|
||||||
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id))
|
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id))
|
||||||
|
|
||||||
#define PHPDBG_BREAK_INIT(b, t) do {\
|
#define PHPDBG_BREAK_INIT(b, t) do {\
|
||||||
|
memset(&b, 0, sizeof(b)); \
|
||||||
b.id = PHPDBG_G(bp_count)++; \
|
b.id = PHPDBG_G(bp_count)++; \
|
||||||
b.type = t; \
|
b.type = t; \
|
||||||
b.disabled = 0;\
|
b.disabled = 0;\
|
||||||
|
@ -192,6 +193,24 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */
|
||||||
|
|
||||||
if (conditional->paramed) {
|
if (conditional->paramed) {
|
||||||
switch (conditional->param.type) {
|
switch (conditional->param.type) {
|
||||||
|
case NUMERIC_FUNCTION_PARAM:
|
||||||
|
phpdbg_asprintf(&new_str,
|
||||||
|
"%sbreak at %s#%ld if %s\n",
|
||||||
|
*str, conditional->param.str, conditional->param.num, conditional->code);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NUMERIC_METHOD_PARAM:
|
||||||
|
phpdbg_asprintf(&new_str,
|
||||||
|
"%sbreak at %s::%s#%ld if %s\n",
|
||||||
|
*str, conditional->param.method.class, conditional->param.method.name, conditional->param.num, conditional->code);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ADDR_PARAM:
|
||||||
|
phpdbg_asprintf(&new_str,
|
||||||
|
"%sbreak at 0X%lx if %s\n",
|
||||||
|
*str, conditional->param.addr, conditional->code);
|
||||||
|
break;
|
||||||
|
|
||||||
case STR_PARAM:
|
case STR_PARAM:
|
||||||
phpdbg_asprintf(&new_str,
|
phpdbg_asprintf(&new_str,
|
||||||
"%sbreak at %s if %s\n", *str, conditional->param.str, conditional->code);
|
"%sbreak at %s if %s\n", *str, conditional->param.str, conditional->code);
|
||||||
|
@ -835,6 +854,20 @@ static inline void phpdbg_create_conditional_break(phpdbg_breakcond_t *brake, co
|
||||||
new_break.paramed = 1;
|
new_break.paramed = 1;
|
||||||
phpdbg_copy_param(
|
phpdbg_copy_param(
|
||||||
param, &new_break.param);
|
param, &new_break.param);
|
||||||
|
if (new_break.param.type == FILE_PARAM ||
|
||||||
|
new_break.param.type == NUMERIC_FILE_PARAM) {
|
||||||
|
char realpath[MAXPATHLEN];
|
||||||
|
|
||||||
|
if (VCWD_REALPATH(new_break.param.file.name, realpath)) {
|
||||||
|
efree(new_break.param.file.name);
|
||||||
|
|
||||||
|
new_break.param.file.name = estrdup(realpath);
|
||||||
|
} else {
|
||||||
|
phpdbg_error("eval", "type=\"invalidparameter\"", "Invalid file for conditional break %s", new_break.param.file.name);
|
||||||
|
phpdbg_clear_param(&new_break.param);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
new_break.paramed = 0;
|
new_break.paramed = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue