[xdebug-dev] xdebug xdebug/xdebug.c - Fixed implementation for FR #124: It was only done when remote debugging was

From: Derick Rethans <derick[@]derickrethans.nl>
Date: Tue, 24 Jan 2006 23:13:04 +0100

Date: Tue Jan 24 23:13:04 CET 2006
User: Derick Rethans
Directory: xdebug

Log Message:
[0.25]
- Fixed implementation for FR #124: It was only done when remote debugging was
  enabled.

Modified files:
           xdebug/xdebug.c (version: 1.292)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -r1.291 -r1.292
--- xdebug/xdebug.c:1.291 Tue Jan 24 20:26:41 2006 GMT
+++ xdebug/xdebug.c Tue Jan 24 21:13:03 2006 GMT
@@ -1663,10 +1663,24 @@
 #ifdef ZEND_ENGINE_2
 void xdebug_throw_exception_hook(zval *exception TSRMLS_DC)
 {
+ zval *message, *file, *line;
+#if PHP_MAJOR_VERSION >= 6
+ zend_class_entry *default_ce = zend_exception_get_default(TSRMLS_C);
+#else
+ zend_class_entry *default_ce = zend_exception_get_default();
+#endif
+ zend_class_entry *exception_ce = zend_get_class_entry(exception TSRMLS_CC);
+
         if (!exception) {
                 return;
         }
 
+ message = zend_read_property(default_ce, exception, "message", sizeof("message")-1, 0 TSRMLS_CC);
+ file = zend_read_property(default_ce, exception, "file", sizeof("file")-1, 0 TSRMLS_CC);
+ line = zend_read_property(default_ce, exception, "line", sizeof("line")-1, 0 TSRMLS_CC);
+
+ print_stack(!(strcmp("cli", sapi_module.name) == 0), exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line), !PG(display_errors) TSRMLS_CC);
+
         /* Start JIT if requested and not yet enabled */
         if (XG(remote_enable) && (XG(remote_mode) == XDEBUG_JIT) && !XG(remote_enabled)) {
                 XG(context).socket = xdebug_create_socket(XG(remote_host), XG(remote_port));
@@ -1680,23 +1694,11 @@
                 }
         }
         if (XG(remote_enabled)) {
- zval *message, *file, *line;
-#if PHP_MAJOR_VERSION >= 6
- zend_class_entry *default_ce = zend_exception_get_default(TSRMLS_C);
-#else
- zend_class_entry *default_ce = zend_exception_get_default();
-#endif
- zend_class_entry *exception_ce = zend_get_class_entry(exception TSRMLS_CC);
-
- message = zend_read_property(default_ce, exception, "message", sizeof("message")-1, 0 TSRMLS_CC);
- file = zend_read_property(default_ce, exception, "file", sizeof("file")-1, 0 TSRMLS_CC);
- line = zend_read_property(default_ce, exception, "line", sizeof("line")-1, 0 TSRMLS_CC);
 
                 if (!XG(context).handler->remote_error(&(XG(context)), 0, exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line), XG(stack))) {
                         XG(remote_enabled) = 0;
                 }
 
- print_stack(!(strcmp("cli", sapi_module.name) == 0), exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line), !PG(display_errors) TSRMLS_CC);
         }
 }
 
Received on Tue Jan 24 2006 - 23:13:05 GMT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST