Date: Sat May 1 23:25:28 CEST 2004
User: Derick Rethans
Directory: xdebug
Log Message:
[0.50]
- Added a new php.ini setting "xdebug.trace_options" to configure extra
options for trace dumping.
- Added the XDEBUG_TRACE_APPEND option (1) as trace option. This can be set
with the ini setting above (only the number "1"), or passed as 2nd parameter
to xdebug_start_trace() (both the number "1" or the constant
XDEBUG_TRACE_APPEND).
Modified files:
xdebug/php_xdebug.h (version: 1.74)
xdebug/xdebug.c (version: 1.216)
xdebug/xdebug_private.h (version: 1.10)
[FILE: /xdebug/php_xdebug.h]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- xdebug/php_xdebug.h:1.73 Tue Apr 20 19:51:55 2004 GMT
+++ xdebug/php_xdebug.h Sat May 01 19:25:28 2004 GMT
@@ -111,6 +111,7 @@
zend_bool auto_trace;
char *trace_output_dir;
char *trace_output_name;
+ long trace_options;
char *tracefile_name;
/* used for code coverage */
[FILE: /xdebug/xdebug.c]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -r1.215 -r1.216
--- xdebug/xdebug.c:1.215 Thu Apr 22 17:00:48 2004 GMT
+++ xdebug/xdebug.c Sat May 01 19:25:28 2004 GMT
@@ -50,6 +50,7 @@
#include "zend_API.h"
#include "zend_execute.h"
#include "zend_compile.h"
+#include "zend_constants.h"
#include "zend_extensions.h"
#ifdef ZEND_ENGINE_2
#include "zend_exceptions.h"
@@ -220,6 +221,11 @@
STD_PHP_INI_BOOLEAN("xdebug.auto_trace", "0", PHP_INI_ALL, OnUpdateBool, auto_trace, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_ENTRY("xdebug.trace_output_dir", "/tmp", PHP_INI_ALL, OnUpdateString, trace_output_dir, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_ENTRY("xdebug.trace_output_name", "crc32", PHP_INI_ALL, OnUpdateString, trace_output_name, zend_xdebug_globals, xdebug_globals)
+#if ZEND_EXTENSION_API_NO < 90000000
+ STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateInt, trace_options, zend_xdebug_globals, xdebug_globals)
+#else
+ STD_PHP_INI_ENTRY("xdebug.trace_options", "0", PHP_INI_ALL, OnUpdateLong, trace_options, zend_xdebug_globals, xdebug_globals)
+#endif
STD_PHP_INI_BOOLEAN("xdebug.collect_includes","1", PHP_INI_ALL, OnUpdateBool, collect_includes, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.collect_params", "0", PHP_INI_ALL, OnUpdateBool, collect_params, zend_xdebug_globals, xdebug_globals)
STD_PHP_INI_BOOLEAN("xdebug.collect_return", "0", PHP_INI_ALL, OnUpdateBool, collect_return, zend_xdebug_globals, xdebug_globals)
@@ -381,6 +387,8 @@
zend_error(E_WARNING, "Xdebug MUST be loaded as a Zend extension");
}
+ REGISTER_LONG_CONSTANT("XDEBUG_TRACE_APPEND", XDEBUG_TRACE_OPTION_APPEND, CONST_CS | CONST_PERSISTENT);
+
XG(breakpoint_count) = 0;
return SUCCESS;
}
@@ -476,7 +484,7 @@
XG(profiler_enabled) = 0;
XG(breakpoints_allowed) = 1;
if (XG(auto_trace) && XG(trace_output_dir) && strlen(XG(trace_output_dir))) {
- xdebug_start_trace(NULL TSRMLS_CC);
+ xdebug_start_trace(NULL, XG(trace_options) TSRMLS_CC);
}
/* Initialize some debugger context properties */
@@ -1606,14 +1614,15 @@
char *fname = NULL;
int fname_len = 0;
char *trace_fname;
+ long options = 0;
if (XG(do_trace) == 0) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fname, &fname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &fname, &fname_len, &options) == FAILURE) {
return;
}
if (fname && strlen(fname)) {
- if ((trace_fname = xdebug_start_trace(fname TSRMLS_CC)) != NULL) {
+ if ((trace_fname = xdebug_start_trace(fname, options TSRMLS_CC)) != NULL) {
XG(do_trace) = 1;
RETVAL_STRING(trace_fname, 1);
xdfree(trace_fname);
@@ -1632,7 +1641,7 @@
}
}
-char* xdebug_start_trace(char* fname TSRMLS_DC)
+char* xdebug_start_trace(char* fname, long options TSRMLS_DC)
{
char *str_time;
char *filename;
@@ -1648,7 +1657,11 @@
filename = xdebug_sprintf("%s/trace.%ld.xt", XG(trace_output_dir), getpid());
}
}
- XG(trace_file) = fopen(filename, "w");
+ if (options & XDEBUG_TRACE_OPTION_APPEND) {
+ XG(trace_file) = fopen(filename, "a");
+ } else {
+ XG(trace_file) = fopen(filename, "w");
+ }
XG(tracefile_name) = estrdup(filename);
if (XG(trace_file)) {
str_time = xdebug_get_time();
[FILE: /xdebug/xdebug_private.h]
===================================================================
RCS file: cvstemp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- xdebug/xdebug_private.h:1.9 Fri Apr 16 05:56:22 2004 GMT
+++ xdebug/xdebug_private.h Sat May 01 19:25:28 2004 GMT
@@ -29,7 +29,7 @@
#include "TSRM.h"
#endif
-char* xdebug_start_trace(char* fname TSRMLS_DC);
+char* xdebug_start_trace(char* fname, long options TSRMLS_DC);
void xdebug_stop_trace(TSRMLS_D);
typedef struct xdebug_var {
@@ -66,6 +66,8 @@
#define XDEBUG_MAX_FUNCTION_LEN 1024
+#define XDEBUG_TRACE_OPTION_APPEND 1
+
#define STATUS_STARTING 0
#define STATUS_STOPPING 1
#define STATUS_STOPPED 2
Received on Fri May 07 2004 - 10:27:56 BST
This archive was generated by hypermail 2.2.0 : Sun Jun 24 2018 - 04:00:02 BST