From: krakjoe Date: Tue, 12 Nov 2013 23:17:37 +0000 (+0000) Subject: deploy _write X-Git-Tag: php-5.6.0alpha1~110^2~408 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afa216fd7e2e441a1233305d0e8e404773f27dd8;p=php deploy _write --- diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c index a322373129..8277e166e6 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 4607bf66fd..2a0d976a75 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 af659c03fd..d6067a61bf 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 */