@@ -53,6 +53,7 @@ static inline void _phpdbg_break_mapping(int id, HashTable *table) /* {{{ */
53
53
zend_hash_index_del(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP], (id))
54
54
55
55
#define PHPDBG_BREAK_INIT (b , t ) do {\
56
+ memset(&b, 0, sizeof(b)); \
56
57
b.id = PHPDBG_G(bp_count)++; \
57
58
b.type = t; \
58
59
b.disabled = 0;\
@@ -192,6 +193,24 @@ PHPDBG_API void phpdbg_export_breakpoints_to_string(char **str) /* {{{ */
192
193
193
194
if (conditional -> paramed ) {
194
195
switch (conditional -> param .type ) {
196
+ case NUMERIC_FUNCTION_PARAM :
197
+ phpdbg_asprintf (& new_str ,
198
+ "%sbreak at %s#%ld if %s\n" ,
199
+ * str , conditional -> param .str , conditional -> param .num , conditional -> code );
200
+ break ;
201
+
202
+ case NUMERIC_METHOD_PARAM :
203
+ phpdbg_asprintf (& new_str ,
204
+ "%sbreak at %s::%s#%ld if %s\n" ,
205
+ * str , conditional -> param .method .class , conditional -> param .method .name , conditional -> param .num , conditional -> code );
206
+ break ;
207
+
208
+ case ADDR_PARAM :
209
+ phpdbg_asprintf (& new_str ,
210
+ "%sbreak at 0X%lx if %s\n" ,
211
+ * str , conditional -> param .addr , conditional -> code );
212
+ break ;
213
+
195
214
case STR_PARAM :
196
215
phpdbg_asprintf (& new_str ,
197
216
"%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
835
854
new_break .paramed = 1 ;
836
855
phpdbg_copy_param (
837
856
param , & new_break .param );
857
+ if (new_break .param .type == FILE_PARAM ||
858
+ new_break .param .type == NUMERIC_FILE_PARAM ) {
859
+ char realpath [MAXPATHLEN ];
860
+
861
+ if (VCWD_REALPATH (new_break .param .file .name , realpath )) {
862
+ efree (new_break .param .file .name );
863
+
864
+ new_break .param .file .name = estrdup (realpath );
865
+ } else {
866
+ phpdbg_error ("eval" , "type=\"invalidparameter\"" , "Invalid file for conditional break %s" , new_break .param .file .name );
867
+ phpdbg_clear_param (& new_break .param );
868
+ return ;
869
+ }
870
+ }
838
871
} else {
839
872
new_break .paramed = 0 ;
840
873
}
0 commit comments