Commit: 4112330bb5ba4e1a18191c7586a3567638b44a54
Author: krakjoe <joe.watk...@live.co.uk> Tue, 12 Nov 2013 06:03:37
+0000
Parents: 12926b6aa998c37278cf21b9634c0c23d76fc935
Branches: PHP-5.6
Link:
http://git.php.net/?p=php-src.git;a=commitdiff;h=4112330bb5ba4e1a18191c7586a3567638b44a54
Log:
colourfulness
Changed paths:
M phpdbg.c
M phpdbg.h
M phpdbg_bp.c
M phpdbg_prompt.c
diff --git a/phpdbg.c b/phpdbg.c
index 52998a6..a83e492 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -35,7 +35,7 @@ static inline void
php_phpdbg_globals_ctor(zend_phpdbg_globals *pg) /* {{{ */
pg->last = NULL;
pg->last_params = NULL;
pg->last_params_len = 0;
- pg->flags = PHPDBG_IS_QUIET;
+ pg->flags = PHPDBG_DEFAULT_FLAGS;
} /* }}} */
static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */
@@ -266,6 +266,7 @@ const opt_struct OPTIONS[] = { /* {{{ */
{'e', 1, "exec"},
{'v', 0, "verbose"},
{'s', 0, "step"},
+ {'b', 0, "boring colours"},
{'-', 0, NULL}
}; /* }}} */
@@ -297,7 +298,7 @@ int main(int argc, char *argv[]) /* {{{ */
int ini_entries_len = 0;
char *exec = NULL;
size_t exec_len = 0L;
- zend_ulong flags = PHPDBG_IS_QUIET;
+ zend_ulong flags = PHPDBG_DEFAULT_FLAGS;
char *php_optarg = NULL;
int php_optind = 1;
int opt;
@@ -377,6 +378,10 @@ int main(int argc, char *argv[]) /* {{{ */
case 's': /* set stepping on */
flags |= PHPDBG_IS_STEPPING;
break;
+
+ case 'b': /* set colours off */
+ flags &= ~PHPDBG_IS_COLOURED;
+ break;
}
}
@@ -402,10 +407,6 @@ int main(int argc, char *argv[]) /* {{{ */
phpdbg->ini_entries = ini_entries;
- printf("[Welcome to phpdbg, the interactive PHP debugger, v%s]\n",
PHPDBG_VERSION);
- printf("To get help using phpdbg type \"help\" and press enter\n");
- printf("[Please report bugs to <%s>]\n", PHPDBG_ISSUES);
-
if (phpdbg->startup(phpdbg) == SUCCESS) {
zend_activate(TSRMLS_C);
@@ -430,6 +431,16 @@ int main(int argc, char *argv[]) /* {{{ */
zend_try {
zend_activate_modules(TSRMLS_C);
} zend_end_try();
+
+ /* print blurb */
+ printf(
+ "%sWelcome to phpdbg, the interactive PHP debugger, v%s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_VERSION,
PHPDBG_END_LINE(TSRMLS_C));
+ printf(
+ "[To get help using phpdbg type \"help\" and press enter\n");
+ printf(
+ "%sPlease report bugs to <%s>%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_ISSUES,
PHPDBG_END_LINE(TSRMLS_C));
do {
zend_try {
diff --git a/phpdbg.h b/phpdbg.h
index 2a01829..34b2e56 100644
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -66,7 +66,10 @@
#define PHPDBG_IS_STEPPING 0x00010000
#define PHPDBG_IS_QUIET 0x00100000
-#define PHPDBG_IS_QUITTING 0x01000000 /* }}} */
+#define PHPDBG_IS_QUITTING 0x01000000
+#define PHPDBG_IS_COLOURED 0x10000000
+
+#define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED) /* }}} */
/* {{{ strings */
#define PHPDBG_ISSUES "http://github.com/krakjoe/phpdbg/issues"
@@ -88,4 +91,14 @@ ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
zend_ulong flags; /* phpdbg flags */
ZEND_END_MODULE_GLOBALS(phpdbg)
+/* {{{ colourful helpers */
+#define PHPDBG_RED_LINE(TSRMLS_D) \
+ ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;31m[" : "[")
+#define PHPDBG_BOLD_LINE(TSRMLS_D) \
+ ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64m[" : "[")
+#define PHPDBG_END_LINE(TSRMLS_D) \
+ ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]")
+#define PHPDBG_PROMPT_LINE(TSRMLS_D) \
+ ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64mphpdbg>\033[0m " :
"phpdbg> ") /* }}} */
+
#endif /* PHPDBG_H */
diff --git a/phpdbg_bp.c b/phpdbg_bp.c
index fef5775..8ce2edb 100644
--- a/phpdbg_bp.c
+++ b/phpdbg_bp.c
@@ -68,7 +68,10 @@ void phpdbg_set_breakpoint_file(const char *path, long
line_num TSRMLS_DC) /* {{
zend_llist_add_element(break_files_ptr, &new_break);
printf(
- "[Breakpoint #%d added at %s:%ld]\n", new_break.id,
new_break.filename, new_break.line);
+ "%sBreakpoint #%d added at %s:%ld%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ new_break.id, new_break.filename, new_break.line,
+ PHPDBG_END_LINE(TSRMLS_C));
} /* }}} */
void phpdbg_set_breakpoint_symbol(const char *name TSRMLS_DC) /* {{{ */
@@ -86,9 +89,15 @@ void phpdbg_set_breakpoint_symbol(const char *name
TSRMLS_DC) /* {{{ */
zend_hash_update(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM],
new_break.symbol,
name_len, &new_break, sizeof(phpdbg_breaksymbol_t),
NULL);
- printf("[Breakpoint #%d added at %s]\n", new_break.id,
new_break.symbol);
+ printf(
+ "%sBreakpoint #%d added at %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ new_break.id, new_break.symbol,
+ PHPDBG_END_LINE(TSRMLS_C));
} else {
- printf("[Breakpoint exists at %s]\n", name);
+ printf(
+ "%sBreakpoint exists at %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), name, PHPDBG_END_LINE(TSRMLS_C));
}
} /* }}} */
@@ -121,10 +130,16 @@ void phpdbg_set_breakpoint_method(const char* class_name,
zend_hash_update(class_table, func_name, func_len, &new_break,
sizeof(phpdbg_breakmethod_t), NULL);
printf(
- "[Breakpoint #%d added at %s::%s]\n", new_break.id, class_name,
func_name);
+ "%sBreakpoint #%d added at %s::%s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ new_break.id, class_name, func_name,
+ PHPDBG_END_LINE(TSRMLS_C));
} else {
printf(
- "[Breakpoint exists at %s::%s]\n", class_name, func_name);
+ "%sBreakpoint exists at %s::%s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ class_name, func_name,
+ PHPDBG_END_LINE(TSRMLS_C));
}
} /* }}} */
@@ -143,9 +158,14 @@ void phpdbg_set_breakpoint_opline(const char *name
TSRMLS_DC) /* {{{ */
zend_hash_index_update(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE],
opline, &new_break, sizeof(phpdbg_breakline_t), NULL);
- printf("[Breakpoint #%d added at %s]\n", new_break.id,
new_break.name);
+ printf("%sBreakpoint #%d added at %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ new_break.id, new_break.name,
+ PHPDBG_END_LINE(TSRMLS_C));
} else {
- printf("[Breakpoint exists at %s]\n", name);
+ printf(
+ "%sBreakpoint exists at %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), name, PHPDBG_END_LINE(TSRMLS_C));
}
} /* }}} */
@@ -164,7 +184,11 @@ void phpdbg_set_breakpoint_opline_ex(phpdbg_opline_ptr_t
opline TSRMLS_DC) /* {{
zend_hash_index_update(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE],
(zend_ulong) opline, &new_break, sizeof(phpdbg_breakline_t), NULL);
- printf("[Breakpoint #%d added at %p]\n", new_break.id, (zend_op*)
new_break.opline);
+ printf(
+ "%sBreakpoint #%d added at %p%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ new_break.id, (zend_op*) new_break.opline,
+ PHPDBG_END_LINE(TSRMLS_C));
}
} /* }}} */
@@ -183,7 +207,10 @@ int phpdbg_find_breakpoint_file(zend_op_array *op_array
TSRMLS_DC) /* {{{ */
const phpdbg_breakfile_t *bp = (phpdbg_breakfile_t*)le->data;
if (bp->line == (*EG(opline_ptr))->lineno) {
- printf("[Breakpoint #%d at %s:%ld]\n", bp->id,
bp->filename, bp->line);
+ printf("%sBreakpoint #%d at %s:%ld%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ bp->id, bp->filename, bp->line,
+ PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
}
@@ -217,9 +244,12 @@ int phpdbg_find_breakpoint_symbol(zend_function *fbc
TSRMLS_DC) /* {{{ */
if (zend_hash_find(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], fname,
strlen(fname),
(void**)&bp) == SUCCESS) {
- printf("[Breakpoint #%d in %s() at %s:%u]\n", bp->id,
bp->symbol,
+ printf("%sBreakpoint #%d in %s() at %s:%u%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ bp->id, bp->symbol,
zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C));
+ zend_get_executed_lineno(TSRMLS_C),
+ PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
@@ -239,9 +269,12 @@ int phpdbg_find_breakpoint_method(zend_op_array *ops
TSRMLS_DC) /* {{{ */
strlen(ops->function_name), (void**)&bp) == SUCCESS) {
printf(
- "[Breakpoint #%d in %s::%s() at %s:%u]\n", bp->id,
bp->class_name, bp->func_name,
+ "%sBreakpoint #%d in %s::%s() at %s:%u%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ bp->id, bp->class_name, bp->func_name,
zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C));
+ zend_get_executed_lineno(TSRMLS_C),
+ PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
}
@@ -255,9 +288,12 @@ int phpdbg_find_breakpoint_opline(phpdbg_opline_ptr_t
opline TSRMLS_DC) /* {{{ *
if (zend_hash_index_find(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE],
(zend_ulong) opline,
(void**)&bp) == SUCCESS) {
- printf("[Breakpoint #%d in %s at %s:%u]\n", bp->id, bp->name,
+ printf("%sBreakpoint #%d in %s at %s:%u%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ bp->id, bp->name,
zend_get_executed_filename(TSRMLS_C),
- zend_get_executed_lineno(TSRMLS_C));
+ zend_get_executed_lineno(TSRMLS_C),
+ PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index d255a9d..40db309 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -35,13 +35,17 @@ ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
static PHPDBG_COMMAND(exec) /* {{{ */
{
if (PHPDBG_G(exec)) {
- printf("[Unsetting old execution context: %s]\n",
PHPDBG_G(exec));
+ printf(
+ "%sUnsetting old execution context: %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_G(exec),
PHPDBG_END_LINE(TSRMLS_C));
efree(PHPDBG_G(exec));
PHPDBG_G(exec) = NULL;
}
if (PHPDBG_G(ops)) {
- printf("[Destroying compiled opcodes]\n");
+ printf(
+ "%sDestroying compiled opcodes%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
efree(PHPDBG_G(ops));
PHPDBG_G(ops) = NULL;
@@ -49,7 +53,9 @@ static PHPDBG_COMMAND(exec) /* {{{ */
PHPDBG_G(exec) = estrndup(expr, PHPDBG_G(exec_len) = expr_len);
- printf("[Set execution context: %s]\n", PHPDBG_G(exec));
+ printf(
+ "%sSet execution context: %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_G(exec),
PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
} /* }}} */
@@ -59,20 +65,26 @@ static inline int phpdbg_compile(TSRMLS_D) /* {{{ */
zend_file_handle fh;
if (!EG(in_execution)) {
- printf("[Attempting compilation of %s]\n", PHPDBG_G(exec));
+ printf("%sAttempting compilation of %s%s\n",
PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_G(exec), PHPDBG_END_LINE(TSRMLS_C));
if (php_stream_open_for_zend_ex(PHPDBG_G(exec), &fh,
USE_PATH|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC) == SUCCESS)
{
PHPDBG_G(ops) = zend_compile_file(
&fh, ZEND_INCLUDE TSRMLS_CC);
zend_destroy_file_handle(&fh TSRMLS_CC);
- printf("[Success]\n");
+ printf(
+ "%sSuccess%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
} else {
- printf("[Could not open file %s]\n", PHPDBG_G(exec));
+ printf(
+ "%sCould not open file %s%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_G(exec),
PHPDBG_END_LINE(TSRMLS_C));
}
} else {
- printf("[Cannot compile while in execution]\n");
+ printf(
+ "%sCannot compile while in execution%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
}
return FAILURE;
@@ -83,7 +95,9 @@ static PHPDBG_COMMAND(compile) /* {{{ */
if (PHPDBG_G(exec)) {
if (!EG(in_execution)) {
if (PHPDBG_G(ops)) {
- printf("[Destroying previously compiled
opcodes]\n");
+ printf(
+ "%sDestroying previously compiled opcodes%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
destroy_op_array(PHPDBG_G(ops) TSRMLS_CC);
efree(PHPDBG_G(ops));
PHPDBG_G(ops)=NULL;
@@ -92,7 +106,9 @@ static PHPDBG_COMMAND(compile) /* {{{ */
return phpdbg_compile(TSRMLS_C);
} else {
- printf("[No execution context]\n");
+ printf(
+ "%sNo execution context%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
} /* }}} */
@@ -106,7 +122,11 @@ static PHPDBG_COMMAND(step) /* {{{ */
}
printf(
- "[Stepping %s]\n", (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on" :
"off");
+ "%sStepping %s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ (PHPDBG_G(flags) & PHPDBG_IS_STEPPING) ? "on" : "off",
+ PHPDBG_END_LINE(TSRMLS_C));
+
return SUCCESS;
} /* }}} */
@@ -118,14 +138,14 @@ static PHPDBG_COMMAND(next) /* {{{ */
static PHPDBG_COMMAND(run) /* {{{ */
{
if (EG(in_execution)) {
- printf("[Cannot start another execution while one is in progress]\n");
+ printf("%sCannot start another execution while one is in
progress%s\n", PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
if (PHPDBG_G(ops) || PHPDBG_G(exec)) {
if (!PHPDBG_G(ops)) {
if (phpdbg_compile(TSRMLS_C) == FAILURE) {
- printf("[Failed to compile %s, cannot run]\n",
PHPDBG_G(exec));
+ printf("%sFailed to compile %s, cannot
run%s\n", PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_G(exec), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
}
@@ -137,14 +157,14 @@ static PHPDBG_COMMAND(run) /* {{{ */
zend_execute(EG(active_op_array) TSRMLS_CC);
} zend_catch {
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
- printf("[Caught excetion in VM]\n");
+ printf("%sCaught excetion in VM%s\n",
PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
} else return SUCCESS;
} zend_end_try();
return SUCCESS;
} else {
- printf("[Nothing to execute !]\n");
+ printf("%sNothing to execute !%s\n", PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
} /* }}} */
@@ -171,7 +191,7 @@ static PHPDBG_COMMAND(eval) /* {{{ */
PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
}
} else {
- printf("[No expression provided !]\n");
+ printf("%sNo expression provided !%s\n",
PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
@@ -181,7 +201,7 @@ static PHPDBG_COMMAND(eval) /* {{{ */
static PHPDBG_COMMAND(back) /* {{{ */
{
if (!EG(in_execution)) {
- printf("[Not executing !]\n");
+ printf("%sNot executing !%s\n", PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
zval zbacktrace;
@@ -309,7 +329,7 @@ static PHPDBG_COMMAND(break) /* {{{ */
if (expr_len <= 0L) {
printf(
- "[No expression found]\n");
+ "%sNo expression found%s\n", PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
@@ -325,13 +345,13 @@ static PHPDBG_COMMAND(break) /* {{{ */
path[line_pos - expr] = 0;
if (expand_filepath(path, resolved_name TSRMLS_CC) ==
NULL) {
- printf("[Failed to expand path %s]\n", path);
+ printf("%sFailed to expand path %s%s\n",
PHPDBG_RED_LINE(TSRMLS_C), path, PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
phpdbg_set_breakpoint_file(resolved_name, line_num
TSRMLS_CC);
} else {
- printf("[No line specified in expression %s]\n", expr);
+ printf("%sNo line specified in expression %s%s\n",
PHPDBG_RED_LINE(TSRMLS_C), expr, PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
} else {
@@ -352,7 +372,7 @@ static PHPDBG_COMMAND(break) /* {{{ */
phpdbg_set_breakpoint_method(class, class_len, func,
func_len TSRMLS_CC);
} else {
- printf("[No function found in method expression %s]\n",
expr);
+ printf("%sNo function found in method expression
%s%s\n", PHPDBG_RED_LINE(TSRMLS_C), expr, PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
}
@@ -370,7 +390,7 @@ static PHPDBG_COMMAND(break) /* {{{ */
phpdbg_set_breakpoint_symbol(name TSRMLS_CC);
} else {
- printf("[Malformed break command found]\n");
+ printf("%sMalformed break command found%s\n",
PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
}
@@ -432,7 +452,7 @@ static PHPDBG_COMMAND(clean) /* {{{ */
printf("[\tIncluded: %d]\n",
zend_hash_num_elements(&EG(included_files)));
} else {
printf(
- "[Cannot clean environment while executing]\n");
+ "%sCannot clean environment while executing%s\n",
PHPDBG_RED_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
return FAILURE;
}
@@ -454,11 +474,15 @@ static PHPDBG_COMMAND(clear) /* {{{ */
static PHPDBG_COMMAND(help) /* {{{ */
{
- printf("[Welcome to phpdbg, the interactive PHP debugger, v%s]\n",
PHPDBG_VERSION);
+ printf(
+ "%sWelcome to phpdbg, the interactive PHP debugger, v%s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_VERSION,
PHPDBG_END_LINE(TSRMLS_C));
if (expr_len > 0L) {
if (phpdbg_do_cmd(phpdbg_help_commands, (char*)expr, expr_len
TSRMLS_CC) == FAILURE) {
- printf("failed to find help command: %s/%d\n", expr,
expr_len);
+ printf(
+ "%sFailed to find help command: %s/%lu%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), expr, expr_len,
PHPDBG_END_LINE(TSRMLS_C));
}
} else {
const phpdbg_command_t *prompt_command = phpdbg_prompt_commands;
@@ -466,20 +490,28 @@ static PHPDBG_COMMAND(help) /* {{{ */
printf("To get help regarding a specific command type \"help
command\"\n");
- printf("Commands:\n");
+ printf(
+ "%sCommands:%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
+
while (prompt_command && prompt_command->name) {
printf("\t%s\t%s\n", prompt_command->name,
prompt_command->tip);
++prompt_command;
}
- printf("Helpers Loaded:\n");
+ printf(
+ "%sHelpers Loaded%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));
+
while (help_command && help_command->name) {
printf("\t%s\t%s\n", help_command->name,
help_command->tip);
++help_command;
}
}
- printf("[Please report bugs to <%s>]\n", PHPDBG_ISSUES);
+ printf(
+ "%sPlease report bugs to <%s>%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_ISSUES,
PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
} /* }}} */
@@ -492,7 +524,7 @@ static PHPDBG_COMMAND(quiet) { /* {{{ */
}
printf(
- "[Quietness %s]\n", (PHPDBG_G(flags) & PHPDBG_IS_QUIET) ? "enabled" :
"disabled");
+ "%sQuietness %s%s\n", PHPDBG_BOLD_LINE(TSRMLS_C), (PHPDBG_G(flags) &
PHPDBG_IS_QUIET) ? "enabled" : "disabled", PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
} /* }}} */
@@ -507,7 +539,9 @@ static PHPDBG_COMMAND(list) /* {{{ */
filename = zend_get_executed_filename(TSRMLS_C);
offset = zend_get_executed_lineno(TSRMLS_C);
} else if (!filename) {
- printf("[No file to list]\n");
+ printf(
+ "%sNo file to list%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
@@ -516,7 +550,9 @@ static PHPDBG_COMMAND(list) /* {{{ */
zend_function* fbc;
if (!EG(function_table)) {
- printf("[No function table loaded]\n");
+ printf(
+ "%sNo function table loaded%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
return SUCCESS;
}
@@ -524,7 +560,9 @@ static PHPDBG_COMMAND(list) /* {{{ */
(void**)&fbc) == SUCCESS) {
phpdbg_list_function(fbc TSRMLS_CC);
} else {
- printf("[Function %s not found]\n", expr);
+ printf(
+ "%sFunction %s not found%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), expr,
PHPDBG_END_LINE(TSRMLS_C));
}
}
@@ -578,7 +616,7 @@ int phpdbg_interactive(TSRMLS_D) /* {{{ */
char cmd[PHPDBG_MAX_CMD];
phpdbg_interactive_enter:
- printf("phpdbg> ");
+ printf(PHPDBG_PROMPT_LINE(TSRMLS_C));
while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING) &&
fgets(cmd, PHPDBG_MAX_CMD, stdin) != NULL) {
@@ -588,7 +626,7 @@ phpdbg_interactive_enter:
phpdbg_interactive_enter:
while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
- cmd = readline("phpdbg> ");
+ cmd = readline(PHPDBG_PROMPT_LINE(TSRMLS_C));
cmd_len = strlen(cmd);
#endif
@@ -609,13 +647,16 @@ phpdbg_interactive_enter:
case FAILURE:
if (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
printf(
- "[Failed to execute %s !]\n", cmd);
+ "%sFailed to execute %s !%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C), cmd,
PHPDBG_END_LINE(TSRMLS_C));
}
break;
case PHPDBG_NEXT: {
if (!EG(in_execution)) {
- printf("[Not running]\n");
+ printf(
+ "%sNot running%s\n",
+ PHPDBG_RED_LINE(TSRMLS_C),
PHPDBG_END_LINE(TSRMLS_C));
}
return PHPDBG_NEXT;
}
@@ -640,7 +681,9 @@ static void phpdbg_print_opline(zend_execute_data
*execute_data TSRMLS_DC) /* {{
zend_op *opline = execute_data->opline;
printf(
- "[OPLINE: %p:%s]\n", opline, phpdbg_decode_opcode(opline->opcode));
+ "%sOPLINE: %p:%s%s\n",
+ PHPDBG_BOLD_LINE(TSRMLS_C),
+ opline, phpdbg_decode_opcode(opline->opcode),
PHPDBG_END_LINE(TSRMLS_C));
}
} /* }}} */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php