com php-src: quiet: phpdbg.c phpdbg.h phpdbg_help.c phpdb g_help.h phpdbg_prompt.c
| From: | Bob Weinand | Date: | Sun, 10 Nov 2013 21:23:18 +0000 |
| Subject: | com php-src: quiet: phpdbg.c phpdbg.h phpdbg_help.c phpdb g_help.h phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75168@lists.php.net to get a copy of this message | ||
Commit: 9ba19e82240ec3a37f861f2400d1702ecdc4e655
Author: krakjoe <joe.watkins@live.co.uk> Sun, 10 Nov 2013 21:23:18 +0000
Parents: 26ec44350e6dc9ae489c04d51f1bfa5ccaad66e3
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9ba19e82240ec3a37f861f2400d1702ecdc4e655
Log:
quiet
Changed paths:
M phpdbg.c
M phpdbg.h
M phpdbg_help.c
M phpdbg_help.h
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg.c b/phpdbg.c
index c15c718...e07cb4a 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 c5f6104..c9f3e5e 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 f1e7cc7..4b218f3 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 4b683b6..ed67a3f 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 284f32d..55bf048 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) /* {{{ */