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> ")
-#define PHPDBG_SEP_LINE(TSRMLS_D) do {\
- printf("%s--------------------------------------%s\n", PHPDBG_BOLD_LINE(TSRMLS_C), PHPDBG_END_LINE(TSRMLS_C));\
- } while(0) /* }}} */
-
#endif /* PHPDBG_H */
HashPosition position;
phpdbg_breaksymbol_t *brake;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Function Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_SYM], (void**) &brake, &position) == SUCCESS;
zend_uint class_len = 0;
zend_ulong class_idx = 0L;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Method Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], &position[0]);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD], (void**) &class_table, &position[0]) == SUCCESS;
HashPosition position;
zend_llist *points;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("File Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE], (void**) &points, &position) == SUCCESS;
HashPosition position;
phpdbg_breakline_t *brake;
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_writeln("Opline Breakpoints:");
for (zend_hash_internal_pointer_reset_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], &position);
zend_hash_get_current_data_ex(&PHPDBG_G(bp)[PHPDBG_BREAK_OPLINE], (void**) &brake, &position) == SUCCESS;
PHPDBG_HELP(step) /* {{{ */
{
phpdbg_writeln("You can enable and disable stepping at any phpdbg prompt during execution");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("For example:");
phpdbg_writeln("\t%sstepping 1", PROMPT);
phpdbg_writeln("Will enable stepping");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("While stepping is enabled you are presented with a prompt after the execution of each opcode");
return SUCCESS;
} /* }}} */
PHPDBG_HELP(quiet) /* {{{ */
{
phpdbg_writeln("Setting quietness on will stop the OPLINE output during execution");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("For example:");
phpdbg_writeln("\t%squiet 1", PROMPT);
phpdbg_writeln("Will silence OPLINE output, while");
PHPDBG_HELP(back) /* {{{ */
{
phpdbg_writeln("The backtrace is gathered with the default debug_backtrace functionality.");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("You can set the limit on the trace, for example:");
phpdbg_writeln("\t%sback 5", PROMPT);
phpdbg_writeln("Will limit the number of frames to 5, the default is no limit");
PHPDBG_HELP(list) /* {{{ */
{
phpdbg_writeln("The list command displays N line from current context file.");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("\t%slist 2", PROMPT);
phpdbg_writeln("Will print next 2 lines from the current file");
phpdbg_writeln("\t%slist func", PROMPT);
phpdbg_writeln("Will print the source of the global function \"func\"");
phpdbg_writeln("\t%slist .mine", PROMPT);
phpdbg_writeln("Will print the source of the class method \"mine\"");
+ phpdbg_writeln(EMPTY);
phpdbg_writeln("Note: before listing functions you must have a populated function table, try compile !!");
return SUCCESS;
} /* }}} */
return SUCCESS;
}
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
phpdbg_notice("Execution Context Information:");
#ifdef HAVE_LIBREADLINE
phpdbg_writeln("Readline\tyes");
phpdbg_print_breakpoints(PHPDBG_BREAK_METHOD TSRMLS_CC);
phpdbg_print_breakpoints(PHPDBG_BREAK_OPLINE TSRMLS_CC);
- PHPDBG_SEP_LINE(TSRMLS_C);
+ phpdbg_writeln(SEPARATE);
return SUCCESS;
} /* }}} */
phpdbg_interactive_enter:
while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)) {
- cmd = readline(PHPDBG_PROMPT_LINE(TSRMLS_C));
+ cmd = readline(PROMPT);
cmd_len = strlen(cmd);
#endif
#ifndef PHPDBG_UTILS_H
#define PHPDBG_UTILS_H
-#include "TSRM.h"
-
/**
* Input scan functions
*/
/* {{{ For prompt lines */
#define PROMPT ((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64mphpdbg>\033[0m " : "phpdbg> ") /* }}} */
+/* {{{ For separation */
+#define SEPARATE "------------------------------------------------" /* }}} */
+
#endif /* PHPDBG_UTILS_H */