[xdebug-dev] xdebug xdebug/xdebug.c xdebug/xdebug_handler_dbgp.c xdebug/xdebug_handler_dbgp.h xdebug/xdebug_handler_gdb.c xdebug/xdebug_handler_gdb.h xdebug/xdebug_handler_php3.c xdebug/xdebug_handler_php3.h xdebug/xdebug_handlers.h - distinguish between xdebug and IDE session variables better

From: Shane Caraveo <shane[@]caraveo.com>
Date: Wed, 21 Apr 2004 20:19:32 +0200

Date: Wed Apr 21 20:19:31 CEST 2004
User: Shane Caraveo
Directory: xdebug

Log Message:
[0.5]
- distinguish between xdebug and IDE session variables better
- DBGP_COOKIE is specific to the dbgp protocol
- XDEBUG_SESSION is now used for the xdebug activation cookie
- magic_cookie no longer needs to be provided to the protocol handlers

Modified files:
           xdebug/xdebug.c (version: 1.212)
           xdebug/xdebug_handler_dbgp.c (version: 1.41)
           xdebug/xdebug_handler_dbgp.h (version: 1.11)
           xdebug/xdebug_handler_gdb.c (version: 1.75)
           xdebug/xdebug_handler_gdb.h (version: 1.27)
           xdebug/xdebug_handler_php3.c (version: 1.19)
           xdebug/xdebug_handler_php3.h (version: 1.13)
           xdebug/xdebug_handlers.h (version: 1.30)

[FILE: /xdebug/xdebug.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- xdebug/xdebug.c:1.211 Tue Apr 20 19:51:55 2004 GMT
+++ xdebug/xdebug.c Wed Apr 21 16:19:31 2004 GMT
@@ -840,20 +840,24 @@
                                 zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_START", sizeof("XDEBUG_SESSION_START"), (void **) &dummy) == SUCCESS
                         )) && !(
                                 PG(http_globals)[TRACK_VARS_COOKIE] &&
- zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "DBGP_COOKIE", sizeof("DBGP_COOKIE"), (void **) &dummy) == SUCCESS
+ zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), (void **) &dummy) == SUCCESS
                         )
                 ) {
                         convert_to_string_ex(dummy);
                         magic_cookie = xdstrdup(Z_STRVAL_PP(dummy));
- php_setcookie("DBGP_COOKIE", 10, Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", 10, Z_STRVAL_PP(dummy), Z_STRLEN_PP(dummy), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 } else if (
                         PG(http_globals)[TRACK_VARS_COOKIE] &&
- zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "DBGP_COOKIE", sizeof("DBGP_COOKIE"), (void **) &dummy) == SUCCESS
+ zend_hash_find(PG(http_globals)[TRACK_VARS_COOKIE]->value.ht, "XDEBUG_SESSION", sizeof("XDEBUG_SESSION"), (void **) &dummy) == SUCCESS
                 ) {
                         convert_to_string_ex(dummy);
                         magic_cookie = xdstrdup(Z_STRVAL_PP(dummy));
- } else if (getenv("DBGP_COOKIE")) {
- magic_cookie = xdstrdup(getenv("DBGP_COOKIE"));
+ } else if (getenv("XDEBUG_SESSION")) {
+ magic_cookie = xdstrdup(getenv("XDEBUG_SESSION"));
+ php_setcookie("XDEBUG_SESSION", 10, magic_cookie, strlen(magic_cookie), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ } else if (getenv("XDEBUG_CONFIG")) {
+ magic_cookie = xdstrdup(getenv("XDEBUG_CONFIG"));
+ php_setcookie("XDEBUG_SESSION", 10, magic_cookie, strlen(magic_cookie), time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 }
                         
 
@@ -867,11 +871,12 @@
                                 zend_hash_find(PG(http_globals)[TRACK_VARS_POST]->value.ht, "XDEBUG_SESSION_STOP", sizeof("XDEBUG_SESSION_STOP"), (void **) &dummy) == SUCCESS
                         )
                 ) {
- php_setcookie("DBGP_COOKIE", 10, "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
+ php_setcookie("XDEBUG_SESSION", 10, "", 0, time(NULL) + 3600, "/", 1, NULL, 0, 0 COOKIE_ENCODE TSRMLS_CC);
                 }
 
                 /* Start remote context if requested */
                 if (
+ magic_cookie &&
                         !XG(remote_enabled) &&
                         XG(remote_enable) &&
                         (XG(remote_mode) == XDEBUG_REQ)
@@ -884,7 +889,7 @@
                                 /* Get handler from mode */
                                 XG(context).handler = xdebug_handler_get(XG(remote_handler));
                                 XG(context).program_name = xdstrdup(op_array->filename);
- if (!XG(context).handler->remote_init(&(XG(context)), XDEBUG_REQ, magic_cookie)) {
+ if (!XG(context).handler->remote_init(&(XG(context)), XDEBUG_REQ)) {
                                         XG(remote_enabled) = 0;
                                 }
 
@@ -1360,7 +1365,7 @@
 
                                 /* Get handler from mode */
                                 XG(context).handler = xdebug_handler_get(XG(remote_handler));
- XG(context).handler->remote_init(&(XG(context)), XDEBUG_JIT, NULL);
+ XG(context).handler->remote_init(&(XG(context)), XDEBUG_JIT);
                         }
                 }
                 if (XG(remote_enabled)) {

[FILE: /xdebug/xdebug_handler_dbgp.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- xdebug/xdebug_handler_dbgp.c:1.40 Tue Apr 20 19:51:55 2004 GMT
+++ xdebug/xdebug_handler_dbgp.c Wed Apr 21 16:19:31 2004 GMT
@@ -1536,7 +1536,7 @@
 
 char *xdebug_dbgp_get_revision(void)
 {
- return "$Revision: 1.40 $";
+ return "$Revision: 1.41 $";
 }
 
 int xdebug_dbgp_cmdloop(xdebug_con *context TSRMLS_DC)
@@ -1564,7 +1564,7 @@
 
 }
 
-int xdebug_dbgp_init(xdebug_con *context, int mode, char *magic_cookie)
+int xdebug_dbgp_init(xdebug_con *context, int mode)
 {
         xdebug_dbgp_options *options;
         xdebug_xml_node *response, *child;
@@ -1608,9 +1608,10 @@
         xdebug_xml_add_attribute_ex(response, "language", "PHP", 0, 0);
         xdebug_xml_add_attribute_ex(response, "protocol_version", DBGP_VERSION, 0, 0);
         xdebug_xml_add_attribute_ex(response, "appid", xdebug_sprintf("%d", getpid()), 0, 1);
- if (magic_cookie) {
- xdebug_xml_add_attribute_ex(response, "session", magic_cookie, 0, 0);
- }
+
+ if (getenv("DBGP_COOKIE")) {
+ xdebug_xml_add_attribute_ex(response, "session", xdstrdup(getenv("DBGP_COOKIE")), 0, 1);
+ }
 
         context->buffer = xdmalloc(sizeof(fd_buf));
         context->buffer->buffer = NULL;

[FILE: /xdebug/xdebug_handler_dbgp.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- xdebug/xdebug_handler_dbgp.h:1.10 Tue Apr 20 19:51:55 2004 GMT
+++ xdebug/xdebug_handler_dbgp.h Wed Apr 21 16:19:31 2004 GMT
@@ -80,7 +80,7 @@
 } xdebug_dbgp_options;
 
 
-int xdebug_dbgp_init(xdebug_con *context, int mode, char *magic_cookie);
+int xdebug_dbgp_init(xdebug_con *context, int mode);
 int xdebug_dbgp_deinit(xdebug_con *context);
 int xdebug_dbgp_error(xdebug_con *context, int type, char *exception_type, char *message, const char *location, const uint line, xdebug_llist *stack);
 int xdebug_dbgp_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type);

[FILE: /xdebug/xdebug_handler_gdb.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- xdebug/xdebug_handler_gdb.c:1.74 Fri Apr 16 21:27:33 2004 GMT
+++ xdebug/xdebug_handler_gdb.c Wed Apr 21 16:19:31 2004 GMT
@@ -1321,10 +1321,10 @@
 
 char *xdebug_gdb_get_revision(void)
 {
- return "$Revision: 1.74 $";
+ return "$Revision: 1.75 $";
 }
 
-int xdebug_gdb_init(xdebug_con *context, int mode, char *magic_cookie)
+int xdebug_gdb_init(xdebug_con *context, int mode)
 {
         char *option;
         int ret;

[FILE: /xdebug/xdebug_handler_gdb.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- xdebug/xdebug_handler_gdb.h:1.26 Fri Apr 16 21:27:33 2004 GMT
+++ xdebug/xdebug_handler_gdb.h Wed Apr 21 16:19:31 2004 GMT
@@ -70,7 +70,7 @@
 } xdebug_gdb_options;
 
 
-int xdebug_gdb_init(xdebug_con *context, int mode, char *magic_cookie);
+int xdebug_gdb_init(xdebug_con *context, int mode);
 int xdebug_gdb_deinit(xdebug_con *context);
 int xdebug_gdb_error(xdebug_con *context, int type, char *exception_type, char *message, const char *file, const uint lineno, xdebug_llist *stack);
 int xdebug_gdb_breakpoint(xdebug_con *context, xdebug_llist *stack, char *file, long lineno, int type);

[FILE: /xdebug/xdebug_handler_php3.c]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- xdebug/xdebug_handler_php3.c:1.18 Fri Apr 16 21:27:33 2004 GMT
+++ xdebug/xdebug_handler_php3.c Wed Apr 21 16:19:31 2004 GMT
@@ -74,10 +74,10 @@
 
 char *xdebug_php3_get_revision(void)
 {
- return "$Revision: 1.18 $";
+ return "$Revision: 1.19 $";
 }
 
-int xdebug_php3_init(xdebug_con *context, int mode, char *magic_cookie)
+int xdebug_php3_init(xdebug_con *context, int mode)
 {
         return 1;
 }

[FILE: /xdebug/xdebug_handler_php3.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- xdebug/xdebug_handler_php3.h:1.12 Fri Apr 16 21:27:33 2004 GMT
+++ xdebug/xdebug_handler_php3.h Wed Apr 21 16:19:31 2004 GMT
@@ -22,7 +22,7 @@
 #include "xdebug_handlers.h"
 
 
-int xdebug_php3_init(xdebug_con *context, int mode, char *magic_cookie);
+int xdebug_php3_init(xdebug_con *context, int mode);
 int xdebug_php3_deinit(xdebug_con *context);
 int xdebug_php3_error(xdebug_con *context, int type, char *exception_type, char *message, const char *location, const uint line, xdebug_llist *stack);
 char *xdebug_php3_get_revision(void);

[FILE: /xdebug/xdebug_handlers.h]

===================================================================
RCS file: cvstemp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- xdebug/xdebug_handlers.h:1.29 Fri Apr 16 21:27:33 2004 GMT
+++ xdebug/xdebug_handlers.h Wed Apr 21 16:19:31 2004 GMT
@@ -92,7 +92,7 @@
 
 struct _xdebug_remote_handler {
         /* Init / deinit */
- int (*remote_init)(xdebug_con *h, int mode, char *magic_cookie);
+ int (*remote_init)(xdebug_con *h, int mode);
         int (*remote_deinit)(xdebug_con *h);
 
         /* Stack messages */
Received on Wed Apr 21 2004 - 20:19:36 BST

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