php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
phpdbg_watch.c File Reference
#include "zend.h"
#include "phpdbg.h"
#include "phpdbg_btree.h"
#include "phpdbg_watch.h"
#include "phpdbg_utils.h"
#include "phpdbg_prompt.h"
#include "zend_portability.h"
#include <unistd.h>
#include <sys/mman.h>

Go to the source code of this file.

Data Structures

struct  phpdbg_watch_parse_struct
 

Macros

#define HT_FROM_ZVP(zvp)
 
#define HT_WATCH_OFFSET   (sizeof(zend_refcounted *) + sizeof(uint32_t)) /* we are not interested in gc and flags */
 
#define HT_PTR_HT(ptr)
 
#define HT_WATCH_HT(watch)
 

Functions

bool phpdbg_check_watch_diff (phpdbg_watchtype type, void *oldPtr, void *newPtr)
 
void phpdbg_print_watch_diff (phpdbg_watchtype type, zend_string *name, void *oldPtr, void *newPtr)
 
int phpdbg_watchpoint_segfault_handler (siginfo_t *info, void *context)
 
void phpdbg_set_addr_watchpoint (void *addr, size_t size, phpdbg_watchpoint_t *watch)
 
void phpdbg_set_zval_watchpoint (zval *zv, phpdbg_watchpoint_t *watch)
 
void phpdbg_set_bucket_watchpoint (Bucket *bucket, phpdbg_watchpoint_t *watch)
 
void phpdbg_set_ht_watchpoint (HashTable *ht, phpdbg_watchpoint_t *watch)
 
void phpdbg_watch_backup_data (phpdbg_watchpoint_t *watch)
 
void phpdbg_delete_watch_collision (phpdbg_watchpoint_t *watch)
 
void phpdbg_update_watch_ref (phpdbg_watchpoint_t *watch)
 
void phpdbg_recurse_watch_element (phpdbg_watch_element *element)
 
void phpdbg_remove_watch_element_recursively (phpdbg_watch_element *element)
 
void phpdbg_free_watch_element (phpdbg_watch_element *element)
 
void phpdbg_remove_watchpoint (phpdbg_watchpoint_t *watch)
 
void phpdbg_watch_parent_ht (phpdbg_watch_element *element)
 
phpdbg_watch_elementphpdbg_add_watch_element (phpdbg_watchpoint_t *watch, phpdbg_watch_element *element)
 
phpdbg_watch_elementphpdbg_add_bucket_watch_element (Bucket *bucket, phpdbg_watch_element *element)
 
phpdbg_watch_elementphpdbg_add_ht_watch_element (zval *zv, phpdbg_watch_element *element)
 
bool phpdbg_is_recursively_watched (void *ptr, phpdbg_watch_element *element)
 
void phpdbg_add_recursive_watch_from_ht (phpdbg_watch_element *element, zend_long idx, zend_string *str, zval *zv)
 
void phpdbg_unwatch_parent_ht (phpdbg_watch_element *element)
 
void phpdbg_dissociate_watch_element (phpdbg_watch_element *element, phpdbg_watch_element *until)
 
void phpdbg_free_watch_element_tree (phpdbg_watch_element *element)
 
void phpdbg_queue_element_for_recreation (phpdbg_watch_element *element)
 
bool phpdbg_try_re_adding_watch_element (zval *parent, phpdbg_watch_element *element)
 
void phpdbg_automatic_dequeue_free (phpdbg_watch_element *element)
 
void phpdbg_dequeue_elements_for_recreation (void)
 
void phpdbg_clean_watch_element (phpdbg_watch_element *element)
 
void phpdbg_remove_watch_element (phpdbg_watch_element *element)
 
void phpdbg_backup_watch_element (phpdbg_watch_element *element)
 
void phpdbg_update_watch_element_watch (phpdbg_watch_element *element)
 
void phpdbg_update_watch_collision_elements (phpdbg_watchpoint_t *watch)
 
zend_stringphpdbg_watchpoint_change_collision_name (phpdbg_watchpoint_t *watch)
 
void phpdbg_check_watchpoint (phpdbg_watchpoint_t *watch)
 
void phpdbg_reenable_memory_watches (void)
 
int phpdbg_print_changed_zvals (void)
 
void phpdbg_watch_efree (void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
void phpdbg_list_watchpoints (void)
 
PHPDBG_API int phpdbg_watchpoint_parse_input (char *input, size_t len, HashTable *parent, size_t i, phpdbg_watch_parse_struct *info, bool silent)
 
 switch (param->type)
 
int phpdbg_create_var_watchpoint (char *input, size_t len)
 
void phpdbg_setup_watchpoints (void)
 
void phpdbg_destroy_watchpoints (void)
 
void phpdbg_purge_watchpoint_tree (void)
 

Variables

const phpdbg_command_t phpdbg_watch_commands []
 
return SUCCESS
 

Macro Definition Documentation

◆ HT_FROM_ZVP

#define HT_FROM_ZVP ( zvp)
Value:
(Z_TYPE_P(zvp) == IS_OBJECT ? Z_OBJPROP_P(zvp) : Z_TYPE_P(zvp) == IS_ARRAY ? Z_ARRVAL_P(zvp) : NULL)
#define NULL
Definition gdcache.h:45
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define Z_ARRVAL_P(zval_p)
Definition zend_types.h:987
#define IS_ARRAY
Definition zend_types.h:607
#define IS_OBJECT
Definition zend_types.h:608
#define Z_OBJPROP_P(zval_p)

Definition at line 131 of file phpdbg_watch.c.

◆ HT_PTR_HT

#define HT_PTR_HT ( ptr)
Value:
((HashTable *) (((char *) (ptr)) - HT_WATCH_OFFSET))
void * ptr
Definition ffi.c:3814
#define HT_WATCH_OFFSET
struct _zend_array HashTable
Definition zend_types.h:386

Definition at line 134 of file phpdbg_watch.c.

◆ HT_WATCH_HT

#define HT_WATCH_HT ( watch)
Value:
HT_PTR_HT((watch)->addr.ptr)
#define HT_PTR_HT(ptr)

Definition at line 135 of file phpdbg_watch.c.

◆ HT_WATCH_OFFSET

#define HT_WATCH_OFFSET   (sizeof(zend_refcounted *) + sizeof(uint32_t)) /* we are not interested in gc and flags */

Definition at line 133 of file phpdbg_watch.c.

Function Documentation

◆ phpdbg_add_bucket_watch_element()

phpdbg_watch_element * phpdbg_add_bucket_watch_element ( Bucket * bucket,
phpdbg_watch_element * element )

Definition at line 539 of file phpdbg_watch.c.

◆ phpdbg_add_ht_watch_element()

phpdbg_watch_element * phpdbg_add_ht_watch_element ( zval * zv,
phpdbg_watch_element * element )

Definition at line 547 of file phpdbg_watch.c.

◆ phpdbg_add_recursive_watch_from_ht()

void phpdbg_add_recursive_watch_from_ht ( phpdbg_watch_element * element,
zend_long idx,
zend_string * str,
zval * zv )

Definition at line 573 of file phpdbg_watch.c.

◆ phpdbg_add_watch_element()

phpdbg_watch_element * phpdbg_add_watch_element ( phpdbg_watchpoint_t * watch,
phpdbg_watch_element * element )

Definition at line 506 of file phpdbg_watch.c.

◆ phpdbg_automatic_dequeue_free()

void phpdbg_automatic_dequeue_free ( phpdbg_watch_element * element)

Definition at line 761 of file phpdbg_watch.c.

◆ phpdbg_backup_watch_element()

void phpdbg_backup_watch_element ( phpdbg_watch_element * element)

Definition at line 860 of file phpdbg_watch.c.

◆ phpdbg_check_watch_diff()

bool phpdbg_check_watch_diff ( phpdbg_watchtype type,
void * oldPtr,
void * newPtr )

Definition at line 138 of file phpdbg_watch.c.

◆ phpdbg_check_watchpoint()

void phpdbg_check_watchpoint ( phpdbg_watchpoint_t * watch)

Definition at line 1011 of file phpdbg_watch.c.

◆ phpdbg_clean_watch_element()

void phpdbg_clean_watch_element ( phpdbg_watch_element * element)

Definition at line 970 of file phpdbg_watch.c.

◆ phpdbg_create_var_watchpoint()

int phpdbg_create_var_watchpoint ( char * input,
size_t len )

Definition at line 1410 of file phpdbg_watch.c.

◆ phpdbg_delete_watch_collision()

void phpdbg_delete_watch_collision ( phpdbg_watchpoint_t * watch)

Definition at line 395 of file phpdbg_watch.c.

◆ phpdbg_dequeue_elements_for_recreation()

void phpdbg_dequeue_elements_for_recreation ( void )

Definition at line 773 of file phpdbg_watch.c.

◆ phpdbg_destroy_watchpoints()

void phpdbg_destroy_watchpoints ( void )

Definition at line 1506 of file phpdbg_watch.c.

◆ phpdbg_dissociate_watch_element()

void phpdbg_dissociate_watch_element ( phpdbg_watch_element * element,
phpdbg_watch_element * until )

Definition at line 865 of file phpdbg_watch.c.

◆ phpdbg_free_watch_element()

void phpdbg_free_watch_element ( phpdbg_watch_element * element)

Definition at line 805 of file phpdbg_watch.c.

◆ phpdbg_free_watch_element_tree()

void phpdbg_free_watch_element_tree ( phpdbg_watch_element * element)

Definition at line 896 of file phpdbg_watch.c.

◆ phpdbg_is_recursively_watched()

bool phpdbg_is_recursively_watched ( void * ptr,
phpdbg_watch_element * element )

Definition at line 560 of file phpdbg_watch.c.

◆ phpdbg_list_watchpoints()

void phpdbg_list_watchpoints ( void )

Definition at line 1245 of file phpdbg_watch.c.

◆ phpdbg_print_changed_zvals()

int phpdbg_print_changed_zvals ( void )

Definition at line 1157 of file phpdbg_watch.c.

◆ phpdbg_print_watch_diff()

void phpdbg_print_watch_diff ( phpdbg_watchtype type,
zend_string * name,
void * oldPtr,
void * newPtr )

Definition at line 160 of file phpdbg_watch.c.

◆ phpdbg_purge_watchpoint_tree()

void phpdbg_purge_watchpoint_tree ( void )

Definition at line 1534 of file phpdbg_watch.c.

◆ phpdbg_queue_element_for_recreation()

void phpdbg_queue_element_for_recreation ( phpdbg_watch_element * element)

Definition at line 695 of file phpdbg_watch.c.

◆ phpdbg_recurse_watch_element()

void phpdbg_recurse_watch_element ( phpdbg_watch_element * element)

Definition at line 597 of file phpdbg_watch.c.

◆ phpdbg_reenable_memory_watches()

void phpdbg_reenable_memory_watches ( void )

Definition at line 1125 of file phpdbg_watch.c.

◆ phpdbg_remove_watch_element()

void phpdbg_remove_watch_element ( phpdbg_watch_element * element)

Definition at line 832 of file phpdbg_watch.c.

◆ phpdbg_remove_watch_element_recursively()

void phpdbg_remove_watch_element_recursively ( phpdbg_watch_element * element)

Definition at line 814 of file phpdbg_watch.c.

◆ phpdbg_remove_watchpoint()

void phpdbg_remove_watchpoint ( phpdbg_watchpoint_t * watch)

Definition at line 949 of file phpdbg_watch.c.

◆ phpdbg_set_addr_watchpoint()

void phpdbg_set_addr_watchpoint ( void * addr,
size_t size,
phpdbg_watchpoint_t * watch )

Definition at line 349 of file phpdbg_watch.c.

◆ phpdbg_set_bucket_watchpoint()

void phpdbg_set_bucket_watchpoint ( Bucket * bucket,
phpdbg_watchpoint_t * watch )

Definition at line 362 of file phpdbg_watch.c.

◆ phpdbg_set_ht_watchpoint()

void phpdbg_set_ht_watchpoint ( HashTable * ht,
phpdbg_watchpoint_t * watch )

Definition at line 367 of file phpdbg_watch.c.

◆ phpdbg_set_zval_watchpoint()

void phpdbg_set_zval_watchpoint ( zval * zv,
phpdbg_watchpoint_t * watch )

Definition at line 357 of file phpdbg_watch.c.

◆ phpdbg_setup_watchpoints()

void phpdbg_setup_watchpoints ( void )

Definition at line 1453 of file phpdbg_watch.c.

◆ phpdbg_try_re_adding_watch_element()

bool phpdbg_try_re_adding_watch_element ( zval * parent,
phpdbg_watch_element * element )

Definition at line 719 of file phpdbg_watch.c.

◆ phpdbg_unwatch_parent_ht()

void phpdbg_unwatch_parent_ht ( phpdbg_watch_element * element)

Definition at line 669 of file phpdbg_watch.c.

◆ phpdbg_update_watch_collision_elements()

void phpdbg_update_watch_collision_elements ( phpdbg_watchpoint_t * watch)

Definition at line 934 of file phpdbg_watch.c.

◆ phpdbg_update_watch_element_watch()

void phpdbg_update_watch_element_watch ( phpdbg_watch_element * element)

Definition at line 912 of file phpdbg_watch.c.

◆ phpdbg_update_watch_ref()

void phpdbg_update_watch_ref ( phpdbg_watchpoint_t * watch)

Definition at line 421 of file phpdbg_watch.c.

◆ phpdbg_watch_backup_data()

void phpdbg_watch_backup_data ( phpdbg_watchpoint_t * watch)

Definition at line 372 of file phpdbg_watch.c.

◆ phpdbg_watch_efree()

void phpdbg_watch_efree ( void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 1204 of file phpdbg_watch.c.

◆ phpdbg_watch_parent_ht()

void phpdbg_watch_parent_ht ( phpdbg_watch_element * element)

Definition at line 645 of file phpdbg_watch.c.

◆ phpdbg_watchpoint_change_collision_name()

zend_string * phpdbg_watchpoint_change_collision_name ( phpdbg_watchpoint_t * watch)

Definition at line 983 of file phpdbg_watch.c.

◆ phpdbg_watchpoint_parse_input()

PHPDBG_API int phpdbg_watchpoint_parse_input ( char * input,
size_t len,
HashTable * parent,
size_t i,
phpdbg_watch_parse_struct * info,
bool silent )

Definition at line 1331 of file phpdbg_watch.c.

◆ phpdbg_watchpoint_segfault_handler()

int phpdbg_watchpoint_segfault_handler ( siginfo_t * info,
void * context )

Definition at line 285 of file phpdbg_watch.c.

◆ switch()

switch ( param-> type)

Definition at line 1394 of file phpdbg_watch.c.

Variable Documentation

◆ phpdbg_watch_commands

const phpdbg_command_t phpdbg_watch_commands[]
Initial value:
= {
PHPDBG_COMMAND_D_EX(array, "create watchpoint on an array", 'a', watch_array, &phpdbg_prompt_commands[24], "s", 0),
PHPDBG_COMMAND_D_EX(delete, "delete watchpoint", 'd', watch_delete, &phpdbg_prompt_commands[24], "n", 0),
PHPDBG_COMMAND_D_EX(recursive, "create recursive watchpoints", 'r', watch_recursive, &phpdbg_prompt_commands[24], "s", 0),
}
#define PHPDBG_END_COMMAND
Definition phpdbg_cmd.h:171
#define PHPDBG_COMMAND_D_EX(name, tip, alias, handler, children, args, flags)
Definition phpdbg_cmd.h:161
const phpdbg_command_t phpdbg_prompt_commands[]

Definition at line 124 of file phpdbg_watch.c.

◆ SUCCESS

return SUCCESS

Definition at line 1407 of file phpdbg_watch.c.