Skip to content

Commit

Permalink
Implemented #1183: Add xdebug.show_error_trace setting to allow/disal…
Browse files Browse the repository at this point in the history
…low to show a stack trace for every Error
  • Loading branch information
derickr committed Sep 5, 2015
1 parent 8d63641 commit 6466237
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions php_xdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ ZEND_BEGIN_MODULE_GLOBALS(xdebug)
zend_bool collect_assignments;
zend_bool extended_info;
zend_bool show_ex_trace;
zend_bool show_error_trace;
zend_bool show_local_vars;
zend_bool show_mem_delta;
double start_time;
Expand Down
5 changes: 5 additions & 0 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("xdebug.max_nesting_level", "256", PHP_INI_ALL, OnUpdateLong, max_nesting_level, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_ENTRY("xdebug.max_stack_frames", "-1", PHP_INI_ALL, OnUpdateLong, max_stack_frames, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.overload_var_dump", "1", PHP_INI_ALL, OnUpdateBool, overload_var_dump, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.show_error_trace", "1", PHP_INI_ALL, OnUpdateBool, show_error_trace, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.show_exception_trace", "0", PHP_INI_ALL, OnUpdateBool, show_ex_trace, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.show_local_vars", "0", PHP_INI_ALL, OnUpdateBool, show_local_vars, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.show_mem_delta", "0", PHP_INI_ALL, OnUpdateBool, show_mem_delta, zend_xdebug_globals, xdebug_globals)
Expand Down Expand Up @@ -1480,7 +1481,11 @@ static void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
}
XG(last_exception_trace) = exception_trace;

#if PHP_VERSION_ID >= 70000
if (XG(show_ex_trace) || (instanceof_function(exception_ce, zend_ce_error) && XG(show_error_trace))) {
#else
if (XG(show_ex_trace)) {
#endif
if (PG(log_errors)) {
xdebug_log_stack(STR_NAME_VAL(exception_ce->name), Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line) TSRMLS_CC);
}
Expand Down

0 comments on commit 6466237

Please sign in to comment.