PHP_ARG_ENABLE(phpdbg, for phpdbg support,
[ --enable-phpdbg Build phpdbg], yes, yes)
+PHP_ARG_ENABLE(phpdbg-debug, for phpdbg debug build,
+[ --enable-phpdbg-debug Build phpdbg in debug mode], no, no)
+
if test "$PHP_PHPDBG" != "no"; then
AC_DEFINE(HAVE_PHPDBG, 1, [ ])
-
+
+ if test "$PHP_PHPDBG_DEBUG" != "no"; then
+ AC_DEFINE(PHPDBG_DEBUG, 1, [ ])
+ else
+ AC_DEFINE(PHPDBG_DEBUG, 0, [ ])
+ fi
+
PHP_PHPDBG_CFLAGS="-I$abc_srcdir"
PHP_PHPDBG_FILES="phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c"
if ((command->name_len == expr_len
&& memcmp(cmd, command->name, expr_len) == 0)
|| ((expr_len == 1) && (command->alias && command->alias == cmd_line[0]))) {
-
PHPDBG_G(last) = (phpdbg_command_t*) command;
PHPDBG_G(last_params) = expr;
PHPDBG_G(last_params_len) = (cmd_len - expr_len) ?
(((cmd_len - expr_len) - sizeof(" "))+1) : 0;
-
+
+ phpdbg_debug("phpdbg_do_cmd(%s, \"%s\", %lu)",
+ command->name, PHPDBG_G(last_params), PHPDBG_G(last_params_len));
+
return command->handler(
PHPDBG_G(last_params), PHPDBG_G(last_params_len) TSRMLS_CC);
}
#define phpdbg_write_ex(out, fmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, out, fmt, ##__VA_ARGS__)
#define phpdbg_log_ex(out, fmt, ...) phpdbg_print(P_LOG TSRMLS_CC, out, fmt, ##__VA_ARGS__)
+#if PHPDBG_DEBUG
+# define phpdbg_debug(fmt, ...) phpdbg_print(P_LOG TSRMLS_CC, stderr, fmt, ##__VA_ARGS__)
+#else
+# define phpdbg_debug
+#endif
+
/* {{{ For writing blank lines */
#define EMPTY "" /* }}} */