zend_llist_destroy((zend_llist*)brake);
} /* }}} */
- efree(((phpdbg_breaksymbol_t*)brake)->symbol);
+ static void php_phpdbg_destroy_bp_symbol(void *brake) /* {{{ */
+ {
++ efree((char*)((phpdbg_breaksymbol_t*)brake)->symbol);
+ } /* }}} */
+
static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */
{
- zend_hash_init(&PHPDBG_G(bp_files), 8, NULL, php_phpdbg_destroy_break, 0);
- zend_hash_init(&PHPDBG_G(bp_symbols), 8, NULL, php_phpdbg_destroy_break, 0);
+ zend_hash_init(&PHPDBG_G(bp_files), 8, NULL, php_phpdbg_destroy_bp_file, 0);
+ zend_hash_init(&PHPDBG_G(bp_symbols), 8, NULL, php_phpdbg_destroy_bp_symbol, 0);
return SUCCESS;
} /* }}} */
setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */
#endif
- while ((opt = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 1)) != -1) {
+#ifdef ZTS
+ tsrm_startup(1, 1, 0, NULL);
+
+ tsrm_ls = ts_resource(0);
+#endif
+
- while ((opt = php_getopt(argc, argv, phpdbg_options, &php_optarg, &php_optind, 0, 2)) != -1) {
++ while ((opt = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
+ printf("OPT: %d\n", opt);
switch (opt) {
case 'c':
if (ini_path_override) {
phpdbg->phpinfo_as_text = 1;
phpdbg->php_ini_ignore_cwd = 0;
phpdbg->php_ini_ignore = 0;
- printf("ini_entries: %d\n", ini_entries_len);
+
+ if (ini_entries) {
+ ini_entries = realloc(ini_entries, ini_entries_len + sizeof(phpdbg_ini_hardcoded));
+ memmove(ini_entries + sizeof(phpdbg_ini_hardcoded) - 2, ini_entries, ini_entries_len + 1);
+ memcpy(ini_entries, phpdbg_ini_hardcoded, sizeof(phpdbg_ini_hardcoded) - 2);
+ } else {
+ ini_entries = malloc(sizeof(phpdbg_ini_hardcoded));
+ memcpy(ini_entries, phpdbg_ini_hardcoded, sizeof(phpdbg_ini_hardcoded));
+ }
+ ini_entries_len += sizeof(phpdbg_ini_hardcoded) - 2;
+
phpdbg->ini_entries = ini_entries;
if (phpdbg->startup(phpdbg) == SUCCESS) {