]> granicus.if.org Git - php/commitdiff
export opcode breakpoints
authorkrakjoe <joe.watkins@live.co.uk>
Mon, 25 Nov 2013 18:27:58 +0000 (18:27 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Mon, 25 Nov 2013 18:27:58 +0000 (18:27 +0000)
phpdbg_bp.c

index 182991fe9f7a4f74ea36e91aa89ceb6ac54fa335..de9b90d6dbcb8458a95816d4cd83a2c8fb137b75 100644 (file)
@@ -88,20 +88,20 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */
                                handle, "break %s\n", brake->symbol);
                }
        }
-       
+
        if (PHPDBG_G(flags) & PHPDBG_HAS_METHOD_BP) {
                HashTable *class;
                phpdbg_breakmethod_t *brake;
                HashPosition mposition;
                zend_bool noted = 0;
-               
+
                table = &PHPDBG_G(bp)[PHPDBG_BREAK_METHOD];
-               
+
                for (zend_hash_internal_pointer_reset_ex(table, &position);
                        zend_hash_get_current_data_ex(table, (void**) &class, &position) == SUCCESS;
                        zend_hash_move_forward_ex(table, &position)) {
                        noted = 0;
-                       
+
                        for (zend_hash_internal_pointer_reset_ex(class, &mposition);
                                zend_hash_get_current_data_ex(class, (void**) &brake, &mposition) == SUCCESS;
                                zend_hash_move_forward_ex(class, &mposition)) {
@@ -118,6 +118,23 @@ PHPDBG_API void phpdbg_export_breakpoints(FILE *handle TSRMLS_DC) /* {{{ */
                }
        }
        
+       if (PHPDBG_G(flags) & PHPDBG_HAS_OPCODE_BP) {
+               phpdbg_breakop_t *brake;
+               
+               table = &PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE];
+               
+               phpdbg_notice(
+                       "Exporting opcode breakpoints (%d)", zend_hash_num_elements(table));
+               
+               for (zend_hash_internal_pointer_reset_ex(table, &position);
+                       zend_hash_get_current_data_ex(table, (void**) &brake, &position) == SUCCESS;
+                       zend_hash_move_forward_ex(table, &position)) {
+               
+                       fprintf(
+                               handle, "break op %s\n", brake->name);  
+               }
+       }
+       
        /* export other types here after resolving errors from source command */
        
 } /* }}} */
@@ -245,6 +262,8 @@ PHPDBG_API void phpdbg_set_breakpoint_opcode(const char *name, size_t name_len T
        zend_ulong hash = zend_hash_func(name, name_len);
 
        if (zend_hash_index_exists(&PHPDBG_G(bp)[PHPDBG_BREAK_OPCODE], hash)) {
+               phpdbg_notice(
+                       "Breakpoint exists for %s", name);
                return;
        }