summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg.c
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
committerOndřej Surý <ondrej@sury.org>2014-11-18 20:30:43 +0100
commitf40f1ce174885cd0f526c003eca3fa523e0ef269 (patch)
treece22a7abe1212824c0be6bace0eb49de7249f9f9 /sapi/phpdbg/phpdbg.c
parent1dc5de7731d1bc41002f9b58f798e93f393e6f08 (diff)
downloadphp-f40f1ce174885cd0f526c003eca3fa523e0ef269.tar.gz
New upstream version 5.6.3+dfsgupstream/5.6.3+dfsg
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r--sapi/phpdbg/phpdbg.c88
1 files changed, 67 insertions, 21 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index c881559e6..fa6f84343 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -262,24 +262,12 @@ static PHP_FUNCTION(phpdbg_exec)
}
} /* }}} */
-/* {{{ proto void phpdbg_break([integer type, string expression])
+/* {{{ proto void phpdbg_break_next()
instructs phpdbg to insert a breakpoint at the next opcode */
-static PHP_FUNCTION(phpdbg_break)
+static PHP_FUNCTION(phpdbg_break_next)
{
- if (ZEND_NUM_ARGS() > 0) {
- long type = 0;
- char *expr = NULL;
- int expr_len = 0;
- phpdbg_param_t param;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &type, &expr, &expr_len) == FAILURE) {
- return;
- }
-
- phpdbg_parse_param(expr, expr_len, &param TSRMLS_CC);
- phpdbg_do_break(&param TSRMLS_CC);
- phpdbg_clear_param(&param TSRMLS_CC);
-
+ if (zend_parse_parameters_none() != SUCCESS) {
+ return;
} else if (EG(current_execute_data) && EG(active_op_array)) {
zend_ulong opline_num = (EG(current_execute_data)->opline -
EG(active_op_array)->opcodes);
@@ -289,6 +277,48 @@ static PHP_FUNCTION(phpdbg_break)
}
} /* }}} */
+/* {{{ proto void phpdbg_break_file(string file, integer line) */
+static PHP_FUNCTION(phpdbg_break_file)
+{
+ char *file = NULL;
+ int flen = 0;
+ long line;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &file, &flen, &line) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_file(file, line TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto void phpdbg_break_method(string class, string method) */
+static PHP_FUNCTION(phpdbg_break_method)
+{
+ char *class = NULL,
+ *method = NULL;
+ int clen = 0,
+ mlen = 0;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &class, &clen, &method, &mlen) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_method(class, method TSRMLS_CC);
+} /* }}} */
+
+/* {{{ proto void phpdbg_break_function(string function) */
+static PHP_FUNCTION(phpdbg_break_function)
+{
+ char *function = NULL;
+ int function_len;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &function, &function_len) == FAILURE) {
+ return;
+ }
+
+ phpdbg_set_breakpoint_symbol(function, function_len TSRMLS_CC);
+} /* }}} */
+
/* {{{ proto void phpdbg_clear(void)
instructs phpdbg to clear breakpoints */
static PHP_FUNCTION(phpdbg_clear)
@@ -338,9 +368,21 @@ static PHP_FUNCTION(phpdbg_prompt)
phpdbg_set_prompt(prompt TSRMLS_CC);
} /* }}} */
-ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_arginfo, 0, 0, 0)
- ZEND_ARG_INFO(0, type)
- ZEND_ARG_INFO(0, expression)
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_next_arginfo, 0, 0, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_file_arginfo, 0, 0, 2)
+ ZEND_ARG_INFO(0, file)
+ ZEND_ARG_INFO(0, line)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_method_arginfo, 0, 0, 2)
+ ZEND_ARG_INFO(0, class)
+ ZEND_ARG_INFO(0, method)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(phpdbg_break_function_arginfo, 0, 0, 1)
+ ZEND_ARG_INFO(0, function)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(phpdbg_color_arginfo, 0, 0, 0)
@@ -361,7 +403,10 @@ ZEND_END_ARG_INFO()
zend_function_entry phpdbg_user_functions[] = {
PHP_FE(phpdbg_clear, phpdbg_clear_arginfo)
- PHP_FE(phpdbg_break, phpdbg_break_arginfo)
+ PHP_FE(phpdbg_break_next, phpdbg_break_next_arginfo)
+ PHP_FE(phpdbg_break_file, phpdbg_break_file_arginfo)
+ PHP_FE(phpdbg_break_method, phpdbg_break_method_arginfo)
+ PHP_FE(phpdbg_break_function, phpdbg_break_function_arginfo)
PHP_FE(phpdbg_exec, phpdbg_exec_arginfo)
PHP_FE(phpdbg_color, phpdbg_color_arginfo)
PHP_FE(phpdbg_prompt, phpdbg_prompt_arginfo)
@@ -660,7 +705,8 @@ const char phpdbg_ini_hardcoded[] =
"log_errors=On\n"
"max_execution_time=0\n"
"max_input_time=-1\n"
-"error_log=\n\0";
+"error_log=\n"
+"output_buffering=off\0";
/* overwriteable ini defaults must be set in phpdbg_ini_defaults() */
#define INI_DEFAULT(name, value) \