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 */
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");
PHPDBG_HELP(print);
PHPDBG_HELP(break);
PHPDBG_HELP(back);
+PHPDBG_HELP(quiet);
/**
* 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}
};
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"),
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}
};
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) /* {{{ */