[xdebug-general]

From: Blake Schwendiman <blake[@]mediafence.com>
Date: Tue May 04 2004 - 00:02:10 CEST

Hello Derick,
 
I have two questions. The first is a result of simply trying to get the
debugger (ver 2.0.0 debugclient in DBGp mode) to stop. Apparently I have to
set an environment variable (XDEBUG_CONFIG) to something in order for the
magic_cookie variable to be set (CLI mode) which is a prerequisite for the
debugger to "kick in". Is that right?
 
The second is more like a suggestion than a question. The function
fd_read_line_delim in usefulstuff.c never finds the delimiter if it doesn't
exist at the end of the source file:
 
 while (context->buffer_size < 1 || context->buffer[context->buffer_size -
1] != delim) {

I generally do not place any characters after the ?> in my PHP scripts, so
this function doesn't work correctly when I'm using a small file that does
not have a "\n" at the very end. If I add the "\n" to the file, then
everything is fantastic. Related to this, I've noticed that the
return_source function reads 0 - 999,999 times even if the entire file has
been exhausted after just a couple of lines.
 
I have some other things that I need to do right away, but if I get a chance
and I haven't heard from you, I may try to patch these last two items later.
 
Thanks,
Blake
 
PS: context of above source line:
 
char* fd_read_line_delim(int socket, fd_buf *context, int type, unsigned
char delim, int *length)
{
 int size = 0, newl = 0, nbufsize = 0;
 char *tmp;
 char *tmp_buf = NULL;
 char *ptr;
 char buffer[READ_BUFFER_SIZE + 1];
 
 if (!context->buffer) {
  context->buffer = calloc(1,1);
  context->buffer_size = 0;
 }
 
 while (context->buffer_size < 1 || context->buffer[context->buffer_size -
1] != delim) {
  ptr = context->buffer + context->buffer_size;
  if (type == FD_RL_FILE) {
   newl = read(socket, buffer, READ_BUFFER_SIZE);
  } else {
   newl = recv(socket, buffer, READ_BUFFER_SIZE, 0);
  }
  if (newl > 0) {
   context->buffer = realloc(context->buffer, context->buffer_size + newl +
1);
   memcpy(context->buffer + context->buffer_size, buffer, newl);
   context->buffer_size += newl;
   context->buffer[context->buffer_size] = '\0';
  } else {
   return NULL;
  }
 }
 
 
 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blake Schwendiman
Software Development

 
Received on Tue May 4 00:04:13 2004

This archive was generated by hypermail 2.1.8 : Fri Jul 04 2008 - 21:00:10 CEST