View Issue Details

IDProjectCategoryView StatusLast Update
0000020XdebugInstallationpublic2003-10-09 08:07
Reportertony2001Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000020: fail to build because of php_setcookie()
Descriptionmake
/bin/sh /root/CVS/xdebug_build/libtool --mode=compile gcc -I. -I/root/CVS/xdebug_build -DPHP_ATOM_INC -I/root/CVS/xdebug_build/include -I/root/CVS/xdebug_build/main -I/root/CVS/xdebug_build -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -DHAVE_CONFIG_H -g -O2 -prefer-pic -c /root/CVS/xdebug_build/xdebug.c -o xdebug.lo
 gcc -I. -I/root/CVS/xdebug_build -DPHP_ATOM_INC -I/root/CVS/xdebug_build/include -I/root/CVS/xdebug_build/main -I/root/CVS/xdebug_build -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -DHAVE_CONFIG_H -g -O2 -c /root/CVS/xdebug_build/xdebug.c -fPIC -DPIC -o .libs/xdebug.o
/root/CVS/xdebug_build/xdebug.c: In function `xdebug_execute':
/root/CVS/xdebug_build/xdebug.c:781: error: too few arguments to function `php_setcookie'
/root/CVS/xdebug_build/xdebug.c:794: error: too few arguments to function `php_setcookie'
Additional InformationI can propose such patch:

Index: xdebug.c
===================================================================
RCS file: /dat/cvs/xdebug/xdebug.c,v
retrieving revision 1.160
diff -u -r1.160 xdebug.c
--- xdebug.c 7 Oct 2003 10:56:42 -0000 1.160
+++ xdebug.c 8 Oct 2003 08:07:43 -0000
@@ -754,9 +754,9 @@
 }

 #if PHP_API_VERSION > 20030820
-#define COOKIE_ENCODE , 1
+#define COOKIE_ENCODE 1
 #else
-#define COOKIE_ENCODE
+#define COOKIE_ENCODE 0
 #endif

 void xdebug_execute(zend_op_array *op_array TSRMLS_DC)
@@ -778,7 +778,7 @@
                        zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "xdebug_session", sizeof("xdebug_session"), (void **) &dummy) == SUCCESS
                )
        ) {
- php_setcookie("xdebug_session", 13, "yes", 3, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("xdebug_session", 13, "yes", 3, time(NULL) + 3600, "/", 1, NULL, 0, 0, COOKIE_ENCODE TSRMLS_CC);
        }

        /* Remove session cookie if requested */
@@ -791,7 +791,7 @@
                        zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS
                )
        ) {
- php_setcookie("xdebug_session", 13, "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("xdebug_session", 13, "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0, COOKIE_ENCODE TSRMLS_CC);
        }

        /* Start context if requested */
TagsNo tags attached.
Operating SystemAny
PHP Version5.0.0-dev

Activities

derick

2003-10-08 09:14

administrator   ~0000017

I don't think your patch is correct, as it will break with PHP 4.3 (that's why I made this change in the first place). Which version of xdebug.c do you have?

tony2001

2003-10-08 09:15

reporter   ~0000018

Oops.
Rather stupid patch =(
Will try to find a real solution..

tony2001

2003-10-08 09:20

reporter   ~0000019

Yep, I've already found it myself =(
I just have checked xdebug from CVS.

The real reason is:
in PHP-HEAD PHP_API_VERSION == 20030820 and this check:
#if PHP_API_VERSION > 20030820

should look like:
#if PHP_API_VERSION >= 20030820

tony2001

2003-10-08 13:39

reporter   ~0000020

Reminder sent to derick

Derick, current CVS version of xdebug still fails to build with CVS version of PHP because of error in php_setcookie() call.
Am I wrong with my proposition to change
#if PHP_API_VERSION > 20030820
to
#if PHP_API_VERSION >= 20030820
?
Or this error is my fault?
Thanx.

derick

2003-10-09 08:05

administrator   ~0000021

Yeah, that's wrong too as we need to change the > to >= and not the other way around. I'll be commiting a patch in a minute.

derick

2003-10-09 08:07

administrator   ~0000022

Fixed in CVS.

Issue History

Date Modified Username Field Change
2003-10-08 09:10 tony2001 New Issue
2003-10-08 09:14 derick Note Added: 0000017
2003-10-08 09:14 derick Status new => feedback
2003-10-08 09:15 tony2001 Note Added: 0000018
2003-10-08 09:20 tony2001 Note Added: 0000019
2003-10-08 13:39 tony2001 Note Added: 0000020
2003-10-09 08:05 derick Note Added: 0000021
2003-10-09 08:07 derick Note Added: 0000022
2003-10-09 08:07 derick Status feedback => closed