Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer

Conflicts:
	phpdbg_prompt.c
This commit is contained in:
krakjoe 2014-04-13 08:06:42 +01:00
commit ef86b57f3b
6 changed files with 65 additions and 7 deletions

View file

@ -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;