case EMPTY_PARAM: {
if (PHPDBG_G(exec) || zend_is_executing(TSRMLS_C)) {
if (param->type == EMPTY_PARAM) {
- phpdbg_list_file(phpdbg_current_file(TSRMLS_C), 0, 0 TSRMLS_CC);
- } else phpdbg_list_file(phpdbg_current_file(TSRMLS_C), param->num, 0 TSRMLS_CC);
+ phpdbg_list_file(phpdbg_current_file(TSRMLS_C), 0, 0, 0 TSRMLS_CC);
+ } else phpdbg_list_file(phpdbg_current_file(TSRMLS_C), param->num, 0, 0 TSRMLS_CC);
} else phpdbg_error("Not executing, and execution context not set");
} break;
phpdbg_list_file(
(*ce)->info.user.filename,
(*ce)->info.user.line_end - (*ce)->info.user.line_start + 1,
- (*ce)->info.user.line_start TSRMLS_CC
+ (*ce)->info.user.line_start, 0 TSRMLS_CC
);
} else {
phpdbg_error("The source of the requested class (%s) cannot be found", (*ce)->name);
return SUCCESS;
} /* }}} */
-void phpdbg_list_file(const char *filename, long count, long offset TSRMLS_DC) /* {{{ */
+void phpdbg_list_file(const char *filename, long count, long offset, int highlight TSRMLS_DC) /* {{{ */
{
unsigned char *mem, *pos, *last_pos, *end_pos;
struct stat st;
if (!offset || offset <= line) {
/* Without offset, or offset reached */
- phpdbg_writeln("%05u: %.*s", line, (int)(pos - last_pos), last_pos);
+ if (!highlight) {
+ phpdbg_writeln("%05u: %.*s", line, (int)(pos - last_pos), last_pos);
+ } else {
+ if (highlight != line) {
+ phpdbg_writeln(" %05u: %.*s", line, (int)(pos - last_pos), last_pos);
+ } else phpdbg_writeln(">%05u: %.*s", line, (int)(pos - last_pos), last_pos);
+ }
++displayed;
}
ops = (zend_op_array*)fbc;
phpdbg_list_file(ops->filename,
- ops->line_end - ops->line_start + 1, ops->line_start TSRMLS_CC);
+ ops->line_end - ops->line_start + 1, ops->line_start, 0 TSRMLS_CC);
} /* }}} */
void phpdbg_list_function_byname(const char *str, size_t len TSRMLS_DC)
void phpdbg_list_function_byname(const char *, size_t TSRMLS_DC);
void phpdbg_list_function(const zend_function* TSRMLS_DC);
-void phpdbg_list_file(const char*, long, long TSRMLS_DC);
+void phpdbg_list_file(const char*, long, long, int TSRMLS_DC);
static const phpdbg_command_t phpdbg_list_commands[] = {
PHPDBG_LIST_EX_D(lines, "lists the specified lines", 'l'),
case EMPTY_PARAM: {
if (PHPDBG_G(exec) || zend_is_executing(TSRMLS_C)) {
if (param->type == EMPTY_PARAM) {
- phpdbg_list_file(phpdbg_current_file(TSRMLS_C), 0, 0 TSRMLS_CC);
- } else phpdbg_list_file(phpdbg_current_file(TSRMLS_C), param->num, 0 TSRMLS_CC);
+ phpdbg_list_file(phpdbg_current_file(TSRMLS_C), 0, 0, 0 TSRMLS_CC);
+ } else phpdbg_list_file(phpdbg_current_file(TSRMLS_C), param->num, 0, 0 TSRMLS_CC);
} else phpdbg_error("Not executing, and execution context not set");
} break;
case FILE_PARAM:
- phpdbg_list_file(param->file.name, param->file.line, 0 TSRMLS_CC);
+ phpdbg_list_file(param->file.name, param->file.line, 0, 0 TSRMLS_CC);
break;
case STR_PARAM: {
#define DO_INTERACTIVE() do {\
phpdbg_list_file(\
zend_get_executed_filename(TSRMLS_C), \
- 2, \
+ 3, \
+ zend_get_executed_lineno(TSRMLS_C)-1, \
zend_get_executed_lineno(TSRMLS_C) \
TSRMLS_CC\
);\