derick Sun, 02 Jan 2011 23:38:37 +0000
Revision: http://svn.xdebug.org/cgi-bin/viewvc.cgi?view=rev&revision=3380&root=xdebug
Log:
- Fixed bug #635: Browser output broken with xdebug.show_exception_trace = 1.
Changed paths:
A xdebug/trunk/tests/bug00635.phpt
U xdebug/trunk/xdebug.c
U xdebug/trunk/xdebug_stack.c
U xdebug/trunk/xdebug_stack.h
Added: xdebug/trunk/tests/bug00635.phpt
===================================================================
--- xdebug/trunk/tests/bug00635.phpt (rev 0)
+++ xdebug/trunk/tests/bug00635.phpt 2011-01-02 23:38:37 UTC (rev 3380)
@@ -0,0 +1,41 @@
+--TEST--
+Test for bug #635: Browser output broken with xdebug.show_exception_trace = 1
+--INI--
+html_errors=1
+xdebug.show_exception_trace=1
+xdebug.default_enable=1
+xdebug.file_link_format=
+--FILE--
+<?php
+
+try {
+ throw new Exception('Caught exception');
+} catch (Exception $e) {
+
+}
+
+throw new Exception('Uncaught exception');
+?>
+--EXPECTF--
+<br />
+<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
+<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Exception: Caught exception in %sbug00635.php on line <i>4</i></th></tr>
+<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
+<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
+<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='%sbug00635.php' bgcolor='#eeeeec'>../bug00635.php<b>:</b>0</td></tr>
+</table></font>
+<br />
+<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
+<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Exception: Uncaught exception in %sbug00635.php on line <i>9</i></th></tr>
+<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
+<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
+<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='%sbug00635.php' bgcolor='#eeeeec'>../bug00635.php<b>:</b>0</td></tr>
+</table></font>
+<br />
+<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
+<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Uncaught exception 'Exception' with message 'Uncaught exception' in %sbug00635.php on line <i>9</i></th></tr>
+<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Exception: Uncaught exception in %sbug00635.php on line <i>9</i></th></tr>
+<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
+<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
+<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>%f</td><td bgcolor='#eeeeec' align='right'>%d</td><td bgcolor='#eeeeec'>{main}( )</td><td title='%sbug00635.php' bgcolor='#eeeeec'>../bug00635.php<b>:</b>0</td></tr>
+</table></font>
Modified: xdebug/trunk/xdebug.c
===================================================================
--- xdebug/trunk/xdebug.c 2010-12-29 19:16:34 UTC (rev 3379)
+++ xdebug/trunk/xdebug.c 2011-01-02 23:38:37 UTC (rev 3380)
@@ -1036,7 +1036,13 @@
xdebug_log_stack(exception_ce->name, Z_STRVAL_P(message), Z_STRVAL_P(file), Z_LVAL_P(line) TSRMLS_CC);
}
if (PG(display_errors)) {
- php_printf("%s", exception_trace);
+ xdebug_str tmp_str = { 0, 0, NULL };
+ xdebug_append_error_head(&tmp_str, PG(html_errors) TSRMLS_CC);
+ xdebug_str_add(&tmp_str, exception_trace, 0);
+ xdebug_append_error_footer(&tmp_str, PG(html_errors) TSRMLS_CC);
+
+ php_printf("%s", tmp_str.d);
+ xdebug_str_dtor(tmp_str);
}
}
Modified: xdebug/trunk/xdebug_stack.c
===================================================================
--- xdebug/trunk/xdebug_stack.c 2010-12-29 19:16:34 UTC (rev 3379)
+++ xdebug/trunk/xdebug_stack.c 2011-01-02 23:38:37 UTC (rev 3380)
@@ -246,7 +246,7 @@
return fname.l;
}
-static void xdebug_append_error_head(xdebug_str *str, int html TSRMLS_DC)
+void xdebug_append_error_head(xdebug_str *str, int html TSRMLS_DC)
{
char **formats = select_formats(html TSRMLS_CC);
@@ -416,7 +416,7 @@
}
}
-static void xdebug_append_error_footer(xdebug_str *str, int html TSRMLS_DC)
+void xdebug_append_error_footer(xdebug_str *str, int html TSRMLS_DC)
{
char **formats = select_formats(html TSRMLS_CC);
Modified: xdebug/trunk/xdebug_stack.h
===================================================================
--- xdebug/trunk/xdebug_stack.h 2010-12-29 19:16:34 UTC (rev 3379)
+++ xdebug/trunk/xdebug_stack.h 2011-01-02 23:38:37 UTC (rev 3380)
@@ -22,8 +22,10 @@
#include "xdebug_str.h"
function_stack_entry *xdebug_add_stack_frame(zend_execute_data *zdata, zend_op_array *op_array, int type TSRMLS_DC);
+void xdebug_append_error_head(xdebug_str *str, int html TSRMLS_DC);
void xdebug_append_error_description(xdebug_str *str, int html, const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC);
void xdebug_append_printable_stack(xdebug_str *str, int html TSRMLS_DC);
+void xdebug_append_error_footer(xdebug_str *str, int html TSRMLS_DC);
void xdebug_log_stack(const char *error_type_str, char *buffer, const char *error_filename, const int error_lineno TSRMLS_DC);
void xdebug_do_jit(TSRMLS_D);
int xdebug_handle_hit_value(xdebug_brk_info *brk_info);
Received on Sun Jan 02 2011 - 23:38:38 GMT
This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST