diff options
Diffstat (limited to 'phpdbg_prompt.c')
-rw-r--r-- | phpdbg_prompt.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 31c5d25122..3010c088a5 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -356,6 +356,7 @@ PHPDBG_COMMAND(exec) /* {{{ */ if ((res_len != PHPDBG_G(exec_len)) || (memcmp(res, PHPDBG_G(exec), res_len) != SUCCESS)) { +<<<<<<< HEAD if (PHPDBG_G(exec)) { phpdbg_notice("Unsetting old execution context: %s", PHPDBG_G(exec)); efree(PHPDBG_G(exec)); @@ -366,6 +367,17 @@ PHPDBG_COMMAND(exec) /* {{{ */ if (PHPDBG_G(ops)) { phpdbg_notice("Destroying compiled opcodes"); phpdbg_clean(0 TSRMLS_CC); +======= + *SG(request_info).argv = PHPDBG_G(exec); + php_hash_environment(TSRMLS_C); + + phpdbg_notice("Set execution context: %s", PHPDBG_G(exec)); + } else { + phpdbg_notice("Execution context not changed"); + } + } else { + phpdbg_error("Cannot use %s as execution context, not a valid file or symlink", param->str); +>>>>>>> 3db29ee43960a4e164244a55b0e2a4b23a112e49 } PHPDBG_G(exec) = res; @@ -641,6 +653,29 @@ PHPDBG_COMMAND(run) /* {{{ */ /* reset hit counters */ phpdbg_reset_breakpoints(TSRMLS_C); + if (param->type != EMPTY_PARAM) { + char **argv = emalloc(5 * sizeof(char *)); + int argc = 0; + int i; + char *argv_str = strtok(input->string, " "); + while (argv_str) { + if (argc >= 4 && argc == (argc & -argc)) { + argv = erealloc(argv, (argc * 2 + 1) * sizeof(char *)); + } + argv[++argc] = argv_str; + argv_str = strtok(0, " "); + argv[argc] = estrdup(argv[argc]); + } + argv[0] = SG(request_info).argv[0]; + for (i = SG(request_info).argc; --i;) { + efree(SG(request_info).argv[i]); + } + efree(SG(request_info).argv); + SG(request_info).argv = erealloc(argv, ++argc * sizeof(char *)); + SG(request_info).argc = argc; + php_hash_environment(TSRMLS_C); + } + zend_try { php_output_activate(TSRMLS_C); PHPDBG_G(flags) ^= PHPDBG_IS_INTERACTIVE; |