]> granicus.if.org Git - php/commitdiff
Added breaking upon fatal-ish error
authorBob Weinand <bobwei9@hotmail.com>
Sat, 21 Dec 2013 21:42:11 +0000 (22:42 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Mon, 23 Dec 2013 23:30:37 +0000 (00:30 +0100)
sapi/phpdbg/phpdbg.c

index 17193ed244cec37d8d66e0a351f8124487ff8b73..4b75ce26ca189f4618445e2b46664889d242278b 100644 (file)
@@ -438,6 +438,35 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */
        */
        if (phpdbg_booted) {
                phpdbg_error("%s", message);
+
+               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:
+                               if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {
+                                       phpdbg_list_file(
+                                               zend_get_executed_filename(TSRMLS_C),
+                                               3,
+                                               zend_get_executed_lineno(TSRMLS_C)-1,
+                                               zend_get_executed_lineno(TSRMLS_C)
+                                               TSRMLS_CC
+                                       );
+                               }
+
+                               do {
+                                       switch (phpdbg_interactive(TSRMLS_C)) {
+                                               case PHPDBG_LEAVE:
+                                               case PHPDBG_FINISH:
+                                               case PHPDBG_UNTIL:
+                                               case PHPDBG_NEXT:
+                                                       return;
+                                       }
+                               } while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING));
+
+               }
        } else fprintf(stdout, "%s\n", message);
 }
 /* }}} */