com php-src: add phpdbg_debug function and --enable-php dbg-debug configure option added debug statement to do_cmd in preparation for updates:
config.m 4 phpdbg_prompt.c phpdbg_utils.h

From: Date: Sat, 16 Nov 2013 11:11:47 +0000
Subject: com php-src: add phpdbg_debug function and --enable-php dbg-debug configure option added debug statement to do_cmd in preparation for updates:
config.m 4 phpdbg_prompt.c phpdbg_utils.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-74925@lists.php.net to get a copy of this message
Commit: 19ada893cbe55edc148021951413db87ebccfb44 Author: krakjoe <joe.watkins@live.co.uk> Sat, 16 Nov 2013 11:11:47 +0000 Parents: 3cb6af2cc1bfb0fc494001b42c711eb37532ec89 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=19ada893cbe55edc148021951413db87ebccfb44 Log: add phpdbg_debug function and --enable-phpdbg-debug configure option added debug statement to do_cmd in preparation for updates Changed paths: M config.m4 M phpdbg_prompt..c M phpdbg_utils.h Diff: diff --git a/config.m4 b/config.m4 index 7d6b826..3ee8ec8 100644 --- a/config.m4 +++ b/config.m4 @@ -5,9 +5,18 @@ dnl 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" diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index aef50d8..4baa202 100644 --- a/phpdbg_prompt.c +++ b/phpdbg_prompt.c @@ -681,12 +681,14 @@ int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_le 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); } diff --git a/phpdbg_utils.h b/phpdbg_utils.h index 4174f16..8077d8f 100644 --- a/phpdbg_utils.h +++ b/phpdbg_utils.h @@ -84,6 +84,12 @@ int phpdbg_print(int TSRMLS_DC, FILE*, const char*, ...); #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 "" /* }}} */

« previous php.cvs (#74925) next »