[xdebug-general] Some small suggestions for the source code: GDB / Win32

From: Christof J. Reetz <cjr[@]netplan.de>
Date: Wed, 07 Mar 2007 14:52:02 +0100

Dear Derick,

first, i know that the GDB protocoll is no longer supported, but it is
working for me so far. Therefore i have two changes for You, which You
might choose to integrate.

I've pulled xdebug from cvs today (March 7 2007).

First "Fix" regards the file name handling for breakpoints on a Win32
system.

Second "Fix" disables the start of a new remote session during a remote
session. The sourcecode rearrangement was only done for me to better
understand what's happening there, i did not intend to criticize Your
coding style. With this change i'm able to do something like "eval
SomeArrayVar[SomeIndex]" in a remote session without starting a new session.

Regards,

-- 
Christof J. Reetz
NETPLAN Reetz GbR
Prinz-Carl-Anlage 20
D-67547 Worms
Phone 06241-955231
   Fax 06241-955233
The Text used in this eMail is made from 100% recycled
electrons and magnetic particles. Keep it away from
sunlight, pets, and small children.

*** xdebug/xdebug_handler_gdb.c 2007-02-26 15:43:30.000000000 +0100
--- /usr/local/src/xdebug/xdebug_handler_gdb.c 2007-03-07 14:38:51.821713824 +0100
***************
*** 711,716 ****
--- 711,728 ----
                                  {
                                          tmp_name = xdebug_sprintf("/%s", method->args[0]);
                                  } else {
+
+ // REPLACE | WITH : AND FORWARD SLASH WITH BACKSLASH FOR WINDOWS HTTP SERVER
+
+ if (method->args[0][1] == '|') {
+ char * pSlash;
+
+ method->args[0][1] = ':';
+ pSlash = method->args[0];
+ while (pSlash = strchr (pSlash, '/')) {
+ *pSlash = '\\';
+ }
+ }
                                          tmp_name = xdebug_sprintf("%s", method->args[0]);
                                  }
  #else
***************
*** 816,821 ****
--- 828,845 ----
                                  {
                                          tmp_name = xdebug_sprintf("/%s", method->args[0]);
                                  } else {
+
+ // REPLACE | WITH : AND FORWARD SLASH WITH BACKSLASH FOR WINDOWS HTTP SERVER
+
+ if (method->args[0][1] == '|') {
+ char * pSlash;
+
+ method->args[0][1] = ':';
+ pSlash = method->args[0];
+ while (pSlash = strchr (pSlash, '/')) {
+ *pSlash = '\\';
+ }
+ }
                                          tmp_name = xdebug_sprintf("%s", method->args[0]);
                                  }
  #else
***************
*** 859,864 ****
--- 883,890 ----
          zval retval;
          char *ret_value;
          int old_error_reporting;
+ int zendEvalStatus;
+
          TSRMLS_FETCH();
  
          /* Remember error reporting level */
***************
*** 874,894 ****
          }
  
          XG(breakpoints_allowed) = 0;
! if (zend_eval_string(buffer.d, &retval, "xdebug eval" TSRMLS_CC) == FAILURE) {
! xdebug_str_free(&buffer);
! EG(error_reporting) = old_error_reporting;
! XG(breakpoints_allowed) = 1;
                  return make_message(context, XDEBUG_E_EVAL, "Error evaluating code");
! } else {
! xdebug_str_free(&buffer);
! EG(error_reporting) = old_error_reporting;
! ret_value = return_printable_symbol(context, NULL, &retval);
! SENDMSG(context->socket, xdebug_sprintf("%s\n", ret_value));
! zval_dtor(&retval);
! xdfree(ret_value);
! XG(breakpoints_allowed) = 1;
! return NULL;
! }
  }
  
  char *xdebug_handle_finish(xdebug_con *context, xdebug_arg *args)
--- 900,925 ----
          }
  
          XG(breakpoints_allowed) = 0;
! XG(remote_enabled) = 0;
! XG(remote_enable) = 0;
!
! zendEvalStatus = zend_eval_string(buffer.d, &retval, "xdebug eval" TSRMLS_CC);
!
! xdebug_str_free(&buffer);
! EG(error_reporting) = old_error_reporting;
! XG(breakpoints_allowed) = 1;
! XG(remote_enabled) = 1;
! XG(remote_enable) = 1;
!
! if (zendEvalStatus == FAILURE) {
                  return make_message(context, XDEBUG_E_EVAL, "Error evaluating code");
! }
!
! ret_value = return_printable_symbol(context, NULL, &retval);
! SENDMSG(context->socket, xdebug_sprintf("%s\n", ret_value));
! zval_dtor(&retval);
! xdfree(ret_value);
! return NULL;
  }
  
  char *xdebug_handle_finish(xdebug_con *context, xdebug_arg *args)
Received on Wed Mar 07 2007 - 14:52:45 GMT

This archive was generated by hypermail 2.2.0 : Mon Jun 25 2018 - 06:00:04 BST