Date: Wed Feb 13 13:12:20 CET 2008
User: Derick Rethans
Directory: xdebug
Log Message:
[0.50]
- Merge PHP 5.3 and DBGp fixes from HEAD.
Modified files:
xdebug/xdebug.c (version: 1.400.2.9)
xdebug/xdebug_handler_dbgp.c (version: 1.125.2.3)
xdebug/xdebug_handler_dbgp.h (version: 1.20.2.1)
xdebug/tests/bug00314.phpt (version: 1.1.2.3)
xdebug/tests/stacktrace_html_0.phpt (version: 1.1.2.1)
xdebug/tests/stacktrace_html_1.phpt (version: 1.1.2.1)
xdebug/tests/stacktrace_html_2.phpt (version: 1.1.2.1)
xdebug/tests/stacktrace_html_3.phpt (version: 1.1.2.1)
xdebug/tests/stacktrace_html_4.phpt (version: 1.1.2.1)
xdebug/tests/stacktrace_html_4_novar.phpt (version: 1.1.2.1)
xdebug/tests/trace2.phpt (version: 1.1.2.3)
[FILE: /xdebug/xdebug.c]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.400.2.8
retrieving revision 1.400.2.9
diff -u -r1.400.2.8 -r1.400.2.9
--- xdebug/xdebug.c:1.400.2.8 Wed Nov 21 13:04:25 2007 GMT
+++ xdebug/xdebug.c Wed Feb 13 11:12:20 2008 GMT
@@ -974,6 +974,7 @@
static function_stack_entry *add_stack_frame(zend_execute_data *zdata, zend_op_array *op_array, int type TSRMLS_DC)
{
+ zend_execute_data *edata = EG(current_execute_data);
function_stack_entry *tmp;
zend_op *cur_opcode;
zval **param;
@@ -996,16 +997,16 @@
tmp->symbol_table = NULL;
tmp->execute_data = NULL;
- if (EG(current_execute_data) && EG(current_execute_data)->op_array) {
+ if (edata && edata->op_array) {
/* Normal function calls */
- tmp->filename = xdstrdup(EG(current_execute_data)->op_array->filename);
+ tmp->filename = xdstrdup(edata->op_array->filename);
XG(function_count)++;
- } else if (EG(current_execute_data) &&
- EG(current_execute_data)->prev_execute_data &&
+ } else if (edata &&
+ edata->prev_execute_data &&
XDEBUG_LLIST_TAIL(XG(stack))
) {
/* Ugly hack for call_user_*() type function calls */
- zend_function *tmpf = EG(current_execute_data)->prev_execute_data->function_state.function;
+ zend_function *tmpf = edata->prev_execute_data->function_state.function;
if (tmpf && (tmpf->common.type != 3) && tmpf->common.function_name) {
if (
(strcmp(tmpf->common.function_name, "call_user_func") == 0) ||
@@ -1060,12 +1061,13 @@
}
#endif
} else {
- if (EG(current_execute_data)->opline) {
- cur_opcode = EG(current_execute_data)->opline;
+ if (edata->opline) {
+ cur_opcode = edata->opline;
if (cur_opcode) {
tmp->lineno = cur_opcode->lineno;
}
}
+
if (XG(remote_enabled) || XG(collect_params) || XG(collect_vars)) {
void **p;
int arguments_sent = 0, arguments_wanted = 0, arguments_storage = 0;
@@ -1074,11 +1076,26 @@
* works for both internal and user defined functions.
* op_array->num_args works only for user defined functions so
* we're not using that here. */
+#if PHP_VERSION_ID >= 50300
+ void **curpos = NULL;
+ if ((!edata->opline) || ((edata->opline->opcode == ZEND_DO_FCALL_BY_NAME) || (edata->opline->opcode == ZEND_DO_FCALL))) {
+ curpos = edata->function_state.arguments;
+ arguments_sent = (int)(zend_uintptr_t) *curpos;
+ arguments_wanted = arguments_sent;
+ p = curpos - arguments_sent;
+ } else {
+ p = zend_vm_stack_top(TSRMLS_C) - 1;
+ arguments_sent = (ulong) *p;
+ arguments_wanted = arguments_sent;
+ p = curpos = NULL;
+ }
+#else
if (EG(argument_stack).top >= 2) {
p = EG(argument_stack).top_element - 2;
arguments_sent = (ulong) *p;
arguments_wanted = arguments_sent;
}
+#endif
# if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1) || PHP_MAJOR_VERSION >= 6
if (tmp->user_defined == XDEBUG_EXTERNAL) {
@@ -1107,12 +1124,19 @@
}
# endif
if (XG(collect_params)) {
+#if PHP_VERSION_ID >= 50300
+ if (p) {
+ param = (zval **) p++;
+ tmp->var[tmp->varc].addr = *param;
+ }
+#else
param = NULL;
if (zend_ptr_stack_get_arg(tmp->varc + 1, (void**) ¶m TSRMLS_CC) == SUCCESS) {
if (param) {
tmp->var[tmp->varc].addr = *param;
}
}
+#endif
}
tmp->varc++;
}
@@ -3087,6 +3111,7 @@
ZEND_DLEXPORT void xdebug_init_oparray(zend_op_array *op_array)
{
+ TSRMLS_FETCH();
op_array->reserved[XG(reserved_offset)] = 0;
}
[FILE: /xdebug/xdebug_handler_dbgp.c]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.125.2.2
retrieving revision 1.125.2.3
diff -u -r1.125.2.2 -r1.125.2.3
--- xdebug/xdebug_handler_dbgp.c:1.125.2.2 Sun Oct 28 15:31:52 2007 GMT
+++ xdebug/xdebug_handler_dbgp.c Wed Feb 13 11:12:20 2008 GMT
@@ -62,6 +62,7 @@
#define DBGP_STATUS_STOPPED 3
#define DBGP_STATUS_RUNNING 4
#define DBGP_STATUS_BREAK 5
+#define DBGP_STATUS_DETACHED 6
char *xdebug_dbgp_status_strings[6] =
{"", "starting", "stopping", "stopped", "running", "break"};
@@ -199,12 +200,13 @@
DBGP_FUNC_ENTRY(stderr, XDEBUG_DBGP_NONE)
DBGP_FUNC_ENTRY(stdout, XDEBUG_DBGP_NONE)
- DBGP_CONT_FUNC_ENTRY(stop, XDEBUG_DBGP_NONE)
DBGP_CONT_FUNC_ENTRY(run, XDEBUG_DBGP_NONE)
DBGP_CONT_FUNC_ENTRY(step_into, XDEBUG_DBGP_NONE)
DBGP_CONT_FUNC_ENTRY(step_out, XDEBUG_DBGP_NONE)
DBGP_CONT_FUNC_ENTRY(step_over, XDEBUG_DBGP_NONE)
- DBGP_CONT_FUNC_ENTRY(detach, XDEBUG_DBGP_NONE)
+
+ DBGP_STOP_FUNC_ENTRY(stop, XDEBUG_DBGP_POST_MORTEM)
+ DBGP_STOP_FUNC_ENTRY(detach, XDEBUG_DBGP_NONE)
/* Non standard functions */
DBGP_FUNC_ENTRY(xcmd_profiler_name_get, XDEBUG_DBGP_POST_MORTEM)
@@ -1323,8 +1325,9 @@
DBGP_FUNC(stop)
{
- XG(status) = DBGP_STATUS_STOPPING;
- zend_bailout();
+ XG(status) = DBGP_STATUS_STOPPED;
+ xdebug_xml_add_attribute(*retval, "status", xdebug_dbgp_status_strings[XG(status)]);
+ xdebug_xml_add_attribute(*retval, "reason", xdebug_dbgp_reason_strings[XG(reason)]);
}
DBGP_FUNC(run)
@@ -1371,7 +1374,9 @@
DBGP_FUNC(detach)
{
- XG(status) = DBGP_STATUS_STOPPING;
+ XG(status) = DBGP_STATUS_DETACHED;
+ xdebug_xml_add_attribute(*retval, "status", xdebug_dbgp_status_strings[DBGP_STATUS_STOPPED]);
+ xdebug_xml_add_attribute(*retval, "reason", xdebug_dbgp_reason_strings[XG(reason)]);
XG(remote_enabled) = 0;
xdebug_close_socket(context->socket);
}
@@ -2165,7 +2170,7 @@
}
XG(lastcmd) = command->name;
XG(lasttransid) = xdstrdup(CMD_OPTION('i'));
- if (XG(status) != DBGP_STATUS_STOPPED || (XG(status) == DBGP_STATUS_STOPPED && command->flags & XDEBUG_DBGP_POST_MORTEM)) {
+ if (XG(status) != DBGP_STATUS_STOPPING || (XG(status) == DBGP_STATUS_STOPPING && command->flags & XDEBUG_DBGP_POST_MORTEM)) {
command->handler((xdebug_xml_node**) &retval, context, args TSRMLS_CC);
ret = command->cont;
} else {
@@ -2197,10 +2202,10 @@
char *xdebug_dbgp_get_revision(void)
{
- return "$Revision: 1.125.2.2 $";
+ return "$Revision: 1.125.2.3 $";
}
-static int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC)
+static int xdebug_dbgp_cmdloop(xdebug_con *context, int bail TSRMLS_DC)
{
char *option;
int ret;
@@ -2222,7 +2227,11 @@
xdebug_xml_node_dtor(response);
free(option);
- } while (1 != ret);
+ } while (0 == ret);
+
+ if (bail && XG(status) == DBGP_STATUS_STOPPED) {
+ zend_bailout();
+ }
return ret;
}
@@ -2343,7 +2352,7 @@
context->eval_id_lookup = xdebug_hash_alloc(64, (xdebug_hash_dtor) xdebug_hash_eval_info_dtor);
context->eval_id_sequence = 0;
- xdebug_dbgp_cmdloop(context TSRMLS_CC);
+ xdebug_dbgp_cmdloop(context, 1 TSRMLS_CC);
return 1;
}
@@ -2354,25 +2363,26 @@
xdebug_var_export_options *options;
TSRMLS_FETCH();
- XG(status) = DBGP_STATUS_STOPPED;
- XG(reason) = DBGP_REASON_OK;
- response = xdebug_xml_node_init("response");
- xdebug_xml_add_attribute(response, "xmlns", "urn:debugger_protocol_v1");
- xdebug_xml_add_attribute(response, "xmlns:xdebug", "http://xdebug.org/dbgp/xdebug");
- /* lastcmd and lasttransid are not always set (for example when the
- * connection is severed before the first command is send) */
- if (XG(lastcmd) && XG(lasttransid)) {
- xdebug_xml_add_attribute_ex(response, "command", XG(lastcmd), 0, 0);
- xdebug_xml_add_attribute_ex(response, "transaction_id", XG(lasttransid), 0, 0);
+ if (XG(remote_enabled)) {
+ XG(status) = DBGP_STATUS_STOPPING;
+ XG(reason) = DBGP_REASON_OK;
+ response = xdebug_xml_node_init("response");
+ xdebug_xml_add_attribute(response, "xmlns", "urn:debugger_protocol_v1");
+ xdebug_xml_add_attribute(response, "xmlns:xdebug", "http://xdebug.org/dbgp/xdebug");
+ /* lastcmd and lasttransid are not always set (for example when the
+ * connection is severed before the first command is send) */
+ if (XG(lastcmd) && XG(lasttransid)) {
+ xdebug_xml_add_attribute_ex(response, "command", XG(lastcmd), 0, 0);
+ xdebug_xml_add_attribute_ex(response, "transaction_id", XG(lasttransid), 0, 0);
+ }
+ xdebug_xml_add_attribute_ex(response, "status", xdebug_dbgp_status_strings[XG(status)], 0, 0);
+ xdebug_xml_add_attribute_ex(response, "reason", xdebug_dbgp_reason_strings[XG(reason)], 0, 0);
+
+ send_message(context, response TSRMLS_CC);
+ xdebug_xml_node_dtor(response);
+
+ xdebug_dbgp_cmdloop(context, 0 TSRMLS_CC);
}
- xdebug_xml_add_attribute_ex(response, "status", xdebug_dbgp_status_strings[XG(status)], 0, 0);
- xdebug_xml_add_attribute_ex(response, "reason", xdebug_dbgp_reason_strings[XG(reason)], 0, 0);
-
- send_message(context, response TSRMLS_CC);
- xdebug_xml_node_dtor(response);
-
- xdebug_dbgp_cmdloop(context TSRMLS_CC);
-
if (XG(stdio).php_body_write != NULL && OG(php_body_write)) {
OG(php_body_write) = XG(stdio).php_body_write;
OG(php_header_write) = XG(stdio).php_header_write;
@@ -2463,7 +2473,7 @@
xdfree(errortype);
}
- xdebug_dbgp_cmdloop(context TSRMLS_CC);
+ xdebug_dbgp_cmdloop(context, 1 TSRMLS_CC);
return 1;
}
@@ -2511,7 +2521,7 @@
XG(lastcmd) = NULL;
XG(lasttransid) = NULL;
- xdebug_dbgp_cmdloop(context TSRMLS_CC);
+ xdebug_dbgp_cmdloop(context, 1 TSRMLS_CC);
return 1;
}
[FILE: /xdebug/xdebug_handler_dbgp.h]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -u -r1.20 -r1.20.2.1
--- xdebug/xdebug_handler_dbgp.h:1.20 Mon Feb 26 13:43:30 2007 GMT
+++ xdebug/xdebug_handler_dbgp.h Wed Feb 13 11:12:20 2008 GMT
@@ -74,6 +74,7 @@
#define DBGP_FUNC(name) static void xdebug_dbgp_handle_##name(DBGP_FUNC_PARAMETERS)
#define DBGP_FUNC_ENTRY(name,flags) { #name, xdebug_dbgp_handle_##name, 0, flags },
#define DBGP_CONT_FUNC_ENTRY(name,flags) { #name, xdebug_dbgp_handle_##name, 1, flags },
+#define DBGP_STOP_FUNC_ENTRY(name,flags) { #name, xdebug_dbgp_handle_##name, 2, flags },
#define XDEBUG_DBGP_NONE 0x00
#define XDEBUG_DBGP_POST_MORTEM 0x01
[FILE: /xdebug/tests/bug00314.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- xdebug/tests/bug00314.phpt:1.1.2.2 Sat Oct 27 16:25:41 2007 GMT
+++ xdebug/tests/bug00314.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -10,6 +10,7 @@
xdebug.trace_format=0
log_errors=1
error_log=/tmp/bug315.log
+xdebug.collect_params=3
--FILE--
<?php
@unlink("/tmp/bug315.log");
[FILE: /xdebug/tests/stacktrace_html_0.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_0.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_0.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -31,7 +31,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_0.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>
[FILE: /xdebug/tests/stacktrace_html_1.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_1.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_1.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -31,7 +31,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_1.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>
[FILE: /xdebug/tests/stacktrace_html_2.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_2.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_2.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -34,7 +34,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_2.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>
[FILE: /xdebug/tests/stacktrace_html_3.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_3.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_3.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -34,7 +34,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_3.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>
[FILE: /xdebug/tests/stacktrace_html_4.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_4.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_4.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -34,7 +34,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_4.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>
[FILE: /xdebug/tests/stacktrace_html_4_novar.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- xdebug/tests/stacktrace_html_4_novar.phpt:1.1 Sun Apr 22 10:32:09 2007 GMT
+++ xdebug/tests/stacktrace_html_4_novar.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -34,7 +34,7 @@
?>
--EXPECTF--
<br />
-<font size='1'><table border='1' cellspacing='0' cellpadding='1'>
+<font size='1'><table 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: Call to undefined function poo() in /%s/stacktrace_html_4_novar.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>
[FILE: /xdebug/tests/trace2.phpt]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- xdebug/tests/trace2.phpt:1.1.2.2 Tue Jul 24 18:07:01 2007 GMT
+++ xdebug/tests/trace2.phpt Wed Feb 13 11:12:20 2008 GMT
@@ -39,7 +39,7 @@
unlink($tf);
?>
--EXPECTF--
-<table class='xdebug-trace' border='1' cellspacing='0'>
+<table dir='ltr' class='xdebug-trace' border='1' cellspacing='0'>
<tr><th>#</th><th>Time</th><th colspan='2'>Function</th><th>Location</th></tr>
<tr><td>3</td><td>%f</td><td align='left'> -></td><td>fibonacci_cache()</td><td>%strace2.php:22</td></tr>
<tr><td>4</td><td>%f</td><td align='left'> -></td><td>fibonacci_cache()</td><td>%strace2.php:16</td></tr>
Received on Wed Feb 13 2008 - 13:24:43 GMT
This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:03 BST