diff options
| author | Joe Watkins <krakjoe@php.net> | 2019-03-27 00:02:15 +0100 | 
|---|---|---|
| committer | Joe Watkins <krakjoe@php.net> | 2019-03-27 00:02:15 +0100 | 
| commit | 6d3a2b46930057524c1eebfa574a4869e3f9dd28 (patch) | |
| tree | 1ce838e8edd1229588f1264ca34b3668689fbe21 /sapi/phpdbg/phpdbg_bp.c | |
| parent | 7df8e4fc0abc105cd5d7b933499bdd275459f7ee (diff) | |
| download | php-git-6d3a2b46930057524c1eebfa574a4869e3f9dd28.tar.gz | |
more work on phpdbg conditional breaks
Diffstat (limited to 'sapi/phpdbg/phpdbg_bp.c')
| -rw-r--r-- | sapi/phpdbg/phpdbg_bp.c | 33 | 
1 files changed, 33 insertions, 0 deletions
diff --git a/sapi/phpdbg/phpdbg_bp.c b/sapi/phpdbg/phpdbg_bp.c index 56b814a9df..b9250fda3f 100644 --- a/sapi/phpdbg/phpdbg_bp.c +++ b/sapi/phpdbg/phpdbg_bp.c @@ -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))  #define PHPDBG_BREAK_INIT(b, t) do {\ +	memset(&b, 0, sizeof(b)); \  	b.id = PHPDBG_G(bp_count)++; \  	b.type = t; \  	b.disabled = 0;\ @@ -192,6 +193,24 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */  							if (conditional->paramed) {  								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:  										phpdbg_asprintf(&new_str,  											"%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;  		phpdbg_copy_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 {  		new_break.paramed = 0;  	}  | 
