From: krakjoe Date: Sun, 10 Nov 2013 21:23:18 +0000 (+0000) Subject: quiet X-Git-Tag: php-5.6.0alpha1~110^2~508 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ba19e82240ec3a37f861f2400d1702ecdc4e655;p=php quiet --- diff --git a/phpdbg.c b/phpdbg.c index c15c718b9d..e07cb4ad36 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -32,6 +32,7 @@ static inline void php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */ pg->vmret = 0; pg->quitting = 0; pg->bp_count = 0; + pg->quiet = 0; } /* }}} */ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ diff --git a/phpdbg.h b/phpdbg.h index c5f6104cef..c9f3e5ee3d 100644 --- a/phpdbg.h +++ b/phpdbg.h @@ -57,6 +57,7 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg) zend_bool has_file_bp; /* file-based breakpoint has been set */ zend_bool has_sym_bp; /* symbol-based breakpoint has been set */ zend_bool quitting; /* quitting flag */ + int quiet; /* quiet */ ZEND_END_MODULE_GLOBALS(phpdbg) #endif /* PHPDBG_H */ diff --git a/phpdbg_help.c b/phpdbg_help.c index f1e7cc7568..4b218f31d2 100644 --- a/phpdbg_help.c +++ b/phpdbg_help.c @@ -91,6 +91,18 @@ PHPDBG_HELP(break) /* {{{ */ return SUCCESS; } /* }}} */ +PHPDBG_HELP(quiet) /* {{{ */ +{ + printf("Setting quietness on will stop the OPLINE output during execution\n"); + printf("For example:\n"); + printf("\tphpdbg> quiet 1\n"); + printf("Will silence OPLINE output, while\n"); + printf("\tphpdbg> quiet 0\n"); + printf("Will enable OPLINE output again\n"); + + return SUCCESS; +} /* }}} */ + PHPDBG_HELP(back) /* {{{ */ { printf("The backtrace is gathered with the default debug_backtrace functionality.\n"); diff --git a/phpdbg_help.h b/phpdbg_help.h index 4b683b6893..ed67a3fec2 100644 --- a/phpdbg_help.h +++ b/phpdbg_help.h @@ -42,6 +42,7 @@ PHPDBG_HELP(eval); PHPDBG_HELP(print); PHPDBG_HELP(break); PHPDBG_HELP(back); +PHPDBG_HELP(quiet); /** * Commands @@ -56,7 +57,7 @@ static const phpdbg_command_t phpdbg_help_commands[] = { PHPDBG_HELP_D(print, "printing allows inspection of the execution environment"), PHPDBG_HELP_D(break, "breakpoints allow execution interruption"), PHPDBG_HELP_D(back, "show debug backtrace information during execution"), - + PHPDBG_HELP_D(quiet, "be quiet during execution"), {NULL, 0, 0} }; diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index 284f32d861..55bf0482ec 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -281,6 +281,11 @@ static PHPDBG_COMMAND(help) /* {{{ */ return SUCCESS; } /* }}} */ +static PHPDBG_COMMAND(quiet) { /* {{{ */ + PHPDBG_G(quiet) = atoi(expr); + return SUCCESS; +} /* }}} */ + static const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_COMMAND_D(exec, "set execution context"), PHPDBG_COMMAND_D(compile, "attempt to pre-compile execution context"), @@ -292,6 +297,7 @@ static const phpdbg_command_t phpdbg_prompt_commands[] = { PHPDBG_COMMAND_D(break, "set breakpoint"), PHPDBG_COMMAND_D(back, "show backtrace"), PHPDBG_COMMAND_D(help, "show help menu"), + PHPDBG_COMMAND_D(quiet, "silence some output"), PHPDBG_COMMAND_D(quit, "exit phpdbg"), {NULL, 0, 0} }; @@ -352,9 +358,11 @@ int phpdbg_interactive(int argc, char **argv TSRMLS_DC) /* {{{ */ static void phpdbg_print_opline(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { - zend_op *opline = execute_data->opline; + if (!PHPDBG_G(quiet)) { + zend_op *opline = execute_data->opline; - printf("[OPLINE: %p:%s]\n", opline, phpdbg_decode_opcode(opline->opcode)); + printf("[OPLINE: %p:%s]\n", opline, phpdbg_decode_opcode(opline->opcode)); + } } /* }}} */ void phpdbg_execute_ex(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */