]> granicus.if.org Git - php/commitdiff
Merge branch 'master' of https://github.com/krakjoe/phpdbg
authorkrakjoe <joe.watkins@live.co.uk>
Sun, 10 Nov 2013 22:46:49 +0000 (22:46 +0000)
committerkrakjoe <joe.watkins@live.co.uk>
Sun, 10 Nov 2013 22:46:49 +0000 (22:46 +0000)
1  2 
phpdbg.c
phpdbg_prompt.c
phpdbg_prompt.h

diff --cc phpdbg.c
index 491b55b5f4be1af4691bca905536a7c07bc712c1,73108d799f0886e9138e15b04376db95d0e49483..2ebc5184842876081ff82dd2a3fc6402f17b922f
+++ b/phpdbg.c
@@@ -54,10 -52,15 +55,15 @@@ static void php_phpdbg_destroy_bp_file(
        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;
  } /* }}} */
@@@ -222,14 -180,7 +228,14 @@@ int main(int argc, char *argv[]) /* {{
        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) {
diff --cc phpdbg_prompt.c
Simple merge
diff --cc phpdbg_prompt.h
Simple merge