diff options
author | twosee <twose@qq.com> | 2020-09-10 17:36:04 +0800 |
---|---|---|
committer | twosee <twose@qq.com> | 2020-09-10 17:36:04 +0800 |
commit | bd1d11d352ddfb2c376060d7e7b282636dce1605 (patch) | |
tree | a9d958862030ba3f5f3758fd05e3c1bc9ab5c21f /sapi/phpdbg/phpdbg.c | |
parent | 298d2db62e9e9c13edc495a49cde2a928f8e4a5b (diff) | |
download | php-git-bd1d11d352ddfb2c376060d7e7b282636dce1605.tar.gz |
Simplify error type filter
Closes GH-6049.
Diffstat (limited to 'sapi/phpdbg/phpdbg.c')
-rw-r--r-- | sapi/phpdbg/phpdbg.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index d817349941..4629f94986 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -798,32 +798,25 @@ static void php_sapi_phpdbg_log_message(const char *message, int syslog_type_int return; } - switch (PG(last_error_type)) { - case E_ERROR: - case E_CORE_ERROR: - case E_COMPILE_ERROR: - case E_USER_ERROR: - case E_PARSE: - case E_RECOVERABLE_ERROR: { - const char *file_char = zend_get_executed_filename(); - zend_string *file = zend_string_init(file_char, strlen(file_char), 0); - phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); - zend_string_release(file); - - if (!phpdbg_fully_started) { - return; - } - - do { - switch (phpdbg_interactive(1, NULL)) { - case PHPDBG_LEAVE: - case PHPDBG_FINISH: - case PHPDBG_UNTIL: - case PHPDBG_NEXT: - return; - } - } while (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)); + if (PG(last_error_type) & E_FATAL_ERRORS) { + const char *file_char = zend_get_executed_filename(); + zend_string *file = zend_string_init(file_char, strlen(file_char), 0); + phpdbg_list_file(file, 3, zend_get_executed_lineno() - 1, zend_get_executed_lineno()); + zend_string_release(file); + + if (!phpdbg_fully_started) { + return; } + + do { + switch (phpdbg_interactive(1, NULL)) { + case PHPDBG_LEAVE: + case PHPDBG_FINISH: + case PHPDBG_UNTIL: + case PHPDBG_NEXT: + return; + } + } while (!(PHPDBG_G(flags) & PHPDBG_IS_STOPPING)); } } else { fprintf(stdout, "%s\n", message); |