Common subdirectories: xdebug/.libs and ext/xdebug/.libs Common subdirectories: xdebug/CVS and ext/xdebug/CVS Common subdirectories: xdebug/autom4te.cache and ext/xdebug/autom4te.cache Common subdirectories: xdebug/build and ext/xdebug/build Common subdirectories: xdebug/debugclient and ext/xdebug/debugclient Common subdirectories: xdebug/modules and ext/xdebug/modules Common subdirectories: xdebug/tests and ext/xdebug/tests diff -u xdebug/usefulstuff.c ext/xdebug/usefulstuff.c --- xdebug/usefulstuff.c 2004-03-10 12:46:16.000000000 -0700 +++ ext/xdebug/usefulstuff.c 2004-05-05 08:30:00.501971900 -0700 @@ -54,6 +54,11 @@ ptr = context->buffer + context->buffer_size; if (type == FD_RL_FILE) { newl = read(socket, buffer, READ_BUFFER_SIZE); + + if ( ( newl < READ_BUFFER_SIZE ) && ( 0 != newl ) ) { // eof + buffer[newl] = delim; + newl++; + } } else { newl = recv(socket, buffer, READ_BUFFER_SIZE, 0); } @@ -90,7 +95,7 @@ return tmp; } -void xdebug_explode(char *delim, char *str, xdebug_arg *args, int limit) +void xdebug_explode(char *delim, char *str, xdebug_arg *args, int limit) { char *p1, *p2, *endp; @@ -132,7 +137,7 @@ /* let end point to the last character where needle may start */ end -= needle_len; - + while (p <= end) { while (*p != first) if (++p > end) @@ -286,7 +291,7 @@ { unsigned int crc = ~0; int len; - + len = 0 ; for (len += str_len; str_len--; ++string) { XDEBUG_CRC32(crc, *string); diff -u xdebug/xdebug_handler_dbgp.c ext/xdebug/xdebug_handler_dbgp.c --- xdebug/xdebug_handler_dbgp.c 2004-04-22 11:37:44.000000000 -0700 +++ ext/xdebug/xdebug_handler_dbgp.c 2004-05-05 09:00:18.905764800 -0700 @@ -269,7 +269,7 @@ } file = xdebug_path_from_url(file); - fd = open(file, 0); + fd = open(file, O_RDONLY); xdfree(file); /* Read until the "begin" line has been read */ @@ -283,8 +283,14 @@ line = NULL; } line = fd_read_line(fd, &fd_buffer, FD_RL_FILE); + if ( NULL == line ) + break; i--; } + + if ( i > 0 ) + return source.d; + /* Read until the "end" line has been read */ do { if (line) { @@ -295,7 +301,7 @@ } line = fd_read_line(fd, &fd_buffer, FD_RL_FILE); i++; - } while (i < end + 1 - begin); + } while ((i < end + 1 - begin) && (NULL != line)); /* Print last line */ if (line) { @@ -676,7 +682,7 @@ brk_id = breakpoint_admin_add(context, BREAKPOINT_TYPE_LINE, tmp_name); xdfree(tmp_name); xdebug_llist_insert_next(context->line_breakpoints, XDEBUG_LLIST_TAIL(context->line_breakpoints), (void*) brk_info); - } else + } else if ((strcmp(CMD_OPTION('t'), "call") == 0) || (strcmp(CMD_OPTION('t'), "return") == 0)) { if (strcmp(CMD_OPTION('t'), "call") == 0) { @@ -834,7 +840,7 @@ 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; - + XG(stdio).php_body_write = NULL; XG(stdio).php_header_write = NULL; success = "1"; @@ -931,7 +937,7 @@ begin = strtol(CMD_OPTION('b'), NULL, 10); } if (CMD_OPTION('e')) { - begin = strtol(CMD_OPTION('e'), NULL, 10); + end = strtol(CMD_OPTION('e'), NULL, 10); } source = return_source(filename, begin, end TSRMLS_CC); @@ -977,7 +983,7 @@ xdebug_xml_add_text(*retval, xdstrdup("0")); xdebug_xml_add_attribute(*retval, "supported", "1"); XDEBUG_STR_CASE_END - + XDEBUG_STR_CASE("language_version") xdebug_xml_add_text(*retval, xdstrdup(PHP_VERSION)); xdebug_xml_add_attribute(*retval, "supported", "1"); @@ -1135,7 +1141,7 @@ * * handle the context_id value and set the property in the correct context */ - + if (!name) { /* name */ RETURN_RESULT(XG(status), XG(reason), XDEBUG_ERROR_INVALID_ARGS); } @@ -1179,14 +1185,14 @@ /* XXX TODO * handle the depth value and set the property at a specific stack depth - * + * * handle the context_id value and set the property in the correct context */ - if (CMD_OPTION('d')) { + if (CMD_OPTION('d')) { depth = strtol(CMD_OPTION('d'), NULL, 10); } - if (CMD_OPTION('c')) { + if (CMD_OPTION('c')) { context_id = strtol(CMD_OPTION('c'), NULL, 10); } @@ -1236,7 +1242,7 @@ { function_stack_entry *fse; xdebug_hash *ht; - + if ((fse = xdebug_get_stack_frame(depth TSRMLS_CC))) { ht = fse->used_vars; XG(active_symbol_table) = fse->symbol_table; @@ -1249,7 +1255,7 @@ XG(active_symbol_table) = NULL; return 0; } - + return 1; } @@ -1448,7 +1454,7 @@ case STATE_SKIP_CHAR: state = STATE_NORMAL; break; - + } } while (*ptr); *ret_args = args; @@ -1536,7 +1542,7 @@ char *option; int ret; xdebug_xml_node *response; - + do { option = fd_read_line_delim(context->socket, context->buffer, FD_RL_SOCKET, '\0', NULL); if (!option) { @@ -1660,7 +1666,7 @@ 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; - + XG(stdio).php_body_write = NULL; XG(stdio).php_header_write = NULL; } @@ -1688,7 +1694,7 @@ } /* runtime_allowed = ( - (type != E_ERROR) && + (type != E_ERROR) && (type != E_CORE_ERROR) && (type != E_COMPILE_ERROR) && (type != E_USER_ERROR)