com php-src: deploy _write: phpdbg_prompt.c phpdbg _utils.c phpdbg_utils.h
| From: | Bob Weinand | Date: | Tue, 12 Nov 2013 23:17:37 +0000 |
| Subject: | com php-src: deploy _write: phpdbg_prompt.c phpdbg _utils.c phpdbg_utils.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75047@lists.php.net to get a copy of this message | ||
Commit: afa216fd7e2e441a1233305d0e8e404773f27dd8
Author: krakjoe <joe.watkins@live.co.uk> Tue, 12 Nov 2013 23:17:37 +0000
Parents: a712674964ffbabf93dae6eac6e4394079567a51
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=afa216fd7e2e441a1233305d0e8e404773f27dd8
Log:
deploy _write
Changed paths:
M phpdbg_prompt.c
M phpdbg_utils.c
M phpdbg_utils.h
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index a322373..8277e16 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -194,12 +194,12 @@ static PHPDBG_COMMAND(back) /* {{{ */
zend_hash_get_current_data_ex(Z_ARRVAL(zbacktrace), (void**)&tmp, &position) == SUCCESS;
zend_hash_move_forward_ex(Z_ARRVAL(zbacktrace), &position)) {
if (i++) {
- printf(",\n");
+ phpdbg_write(",");
}
zend_print_flat_zval_r(*tmp TSRMLS_CC);
}
- printf("\n");
+ phpdbg_write(EMPTY);
zval_dtor(&zbacktrace);
return SUCCESS;
@@ -215,34 +215,34 @@ static PHPDBG_COMMAND(print) /* {{{ */
}
PHPDBG_SEP_LINE(TSRMLS_C);
- printf("Execution Context Information:\n");
+ phpdbg_notice("Execution Context Information:");
#ifdef HAVE_LIBREADLINE
- printf("Readline\tyes\n");
+ phpdbg_write("Readline\tyes");
#else
- printf("Readline\tno\n");
+ phpdbg_write("Readline\tno");
#endif
- printf("Exec\t\t%s\n", PHPDBG_G(exec) ? PHPDBG_G(exec) : "none");
- printf("Compiled\t%s\n", PHPDBG_G(ops) ? "yes" : "no");
- printf("Stepping\t%s\n", (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on" :
"off");
- printf("Quietness\t%s\n", (PHPDBG_G(flags) & PHPDBG_IS_QUIET) ? "on" :
"off");
+ phpdbg_write("Exec\t\t%s", PHPDBG_G(exec) ? PHPDBG_G(exec) : "none");
+ phpdbg_write("Compiled\t%s", PHPDBG_G(ops) ? "yes" : "no");
+ phpdbg_write("Stepping\t%s", (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on"
: "off");
+ phpdbg_write("Quietness\t%s", (PHPDBG_G(flags) & PHPDBG_IS_QUIET) ?
"on" : "off");
if (PHPDBG_G(ops)) {
- printf("Opcodes\t\t%d\n", PHPDBG_G(ops)->last);
+ phpdbg_write("Opcodes\t\t%d", PHPDBG_G(ops)->last);
if (PHPDBG_G(ops)->last_var) {
- printf("Variables\t%d\n", PHPDBG_G(ops)->last_var-1);
+ phpdbg_write("Variables\t%d", PHPDBG_G(ops)->last_var-1);
} else {
- printf("Variables\tNone\n");
+ phpdbg_write("Variables\tNone");
}
}
- printf("Executing\t%s\n", EG(in_execution) ? "yes" : "no");
+ phpdbg_write("Executing\t%s", EG(in_execution) ? "yes" : "no");
if (EG(in_execution)) {
- printf("VM Return\t%d\n", PHPDBG_G(vmret));
+ phpdbg_write("VM Return\t%d", PHPDBG_G(vmret));
}
- printf("Classes\t\t%d\n", zend_hash_num_elements(EG(class_table)));
- printf("Functions\t%d\n", zend_hash_num_elements(EG(function_table)));
- printf("Constants\t%d\n", zend_hash_num_elements(EG(zend_constants)));
- printf("Included\t%d\n", zend_hash_num_elements(&EG(included_files)));
+ phpdbg_write("Classes\t\t%d", zend_hash_num_elements(EG(class_table)));
+ phpdbg_write("Functions\t%d", zend_hash_num_elements(EG(function_table)));
+ phpdbg_write("Constants\t%d", zend_hash_num_elements(EG(zend_constants)));
+ phpdbg_write("Included\t%d", zend_hash_num_elements(&EG(included_files)));
phpdbg_print_breakpoints(PHPDBG_BREAK_FILE TSRMLS_CC);
phpdbg_print_breakpoints(PHPDBG_BREAK_SYM TSRMLS_CC);
@@ -407,19 +407,19 @@ static PHPDBG_COMMAND(help) /* {{{ */
const phpdbg_command_t *prompt_command = phpdbg_prompt_commands;
const phpdbg_command_t *help_command = phpdbg_help_commands;
- printf("To get help regarding a specific command type \"help command\"\n");
+ phpdbg_write("To get help regarding a specific command type \"help
command\"");
phpdbg_notice("Commands");
while (prompt_command && prompt_command->name) {
- printf("\t%s\t%s\n", prompt_command->name, prompt_command->tip);
+ phpdbg_write("\t%s\t%s", prompt_command->name, prompt_command->tip);
++prompt_command;
}
phpdbg_notice("Helpers Loaded");
while (help_command && help_command->name) {
- printf("\t%s\t%s\n", help_command->name, help_command->tip);
+ phpdbg_write("\t%s\t%s", help_command->name, help_command->tip);
++help_command;
}
}
diff --git a/phpdbg_utils.c b/phpdbg_utils.c
index 4607bf6..2a0d976 100644
--- a/phpdbg_utils.c
+++ b/phpdbg_utils.c
@@ -98,7 +98,7 @@ void phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */
case WRITE:
printf("%s%s%s\n",
- ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64m" : ""),
+ ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[37m" : ""),
buffer,
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[0m" : ""));
break;
diff --git a/phpdbg_utils.h b/phpdbg_utils.h
index af659c0..d6067a6 100644
--- a/phpdbg_utils.h
+++ b/phpdbg_utils.h
@@ -45,4 +45,7 @@ void phpdbg_print(int TSRMLS_DC, const char*, ...);
#define phpdbg_notice(fmt, ...) phpdbg_print(NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_write(fmt, ...) phpdbg_print(WRITE TSRMLS_CC, fmt, ##__VA_ARGS__)
+/* {{{ For writing blank lines */
+#define EMPTY "" /* }}} */
+
#endif /* PHPDBG_UTILS_H */