Skip to content
Newer
Older
100644 225 lines (180 sloc) 5.51 KB
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 4 |
4 +----------------------------------------------------------------------+
82f2ad3 @derickr - Happy New Year!
authored
5 | Copyright (c) 2002, 2003 The PHP Group |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.02 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available at through the world-wide-web at |
10 | http://www.php.net/license/2_02.txt. |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
05ec637 @derickr - Update NEWS
authored
15 | Authors: Derick Rethans <d.rethans@jdimedia.nl> |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
16 +----------------------------------------------------------------------+
17 */
18
19 #ifndef PHP_XDEBUG_H
20 #define PHP_XDEBUG_H
21
e47e77b @derickr - Added xdebug_call_class() as addition to xdebug_call_function().
authored
22 #define XDEBUG_VERSION "1.2.0"
87f58a5 @derickr - Added "bt" command to get backtraces
authored
23
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
24 #include "php.h"
6005ed2 @derickr - Make it compile under ZTS mode
authored
25
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
26 #include "xdebug_handlers.h"
2983739 @derickr - Implemented the list, print, show, step and pwd commands.
authored
27 #include "xdebug_hash.h"
b5be71c @derickr - srm_llist > xdebug_llist
authored
28 #include "xdebug_llist.h"
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
29
30 extern zend_module_entry xdebug_module_entry;
31 #define phpext_xdebug_ptr &xdebug_module_entry
32
4103a9b @iliaal - Added another profiling mode, which can be accessed via
iliaal authored
33 #define MICRO_IN_SEC 1000000.00
34
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
35 #ifdef PHP_WIN32
36 #define PHP_XDEBUG_API __declspec(dllexport)
37 #else
38 #define PHP_XDEBUG_API
39 #endif
40
41 #ifdef ZTS
42 #include "TSRM.h"
43 #endif
44
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
45 /* Memory allocators */
46 #if 0
47 #define xdmalloc emalloc
48 #define xdcalloc ecalloc
49 #define xdrealloc erealloc
50 #define xdfree efree
51 #define xdstrdup estrdup
52 #else
53 #define xdmalloc malloc
54 #define xdcalloc calloc
55 #define xdrealloc realloc
56 #define xdfree free
57 #define xdstrdup strdup
58 #endif
59
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
60 PHP_MINIT_FUNCTION(xdebug);
61 PHP_MSHUTDOWN_FUNCTION(xdebug);
62 PHP_RINIT_FUNCTION(xdebug);
63 PHP_RSHUTDOWN_FUNCTION(xdebug);
64 PHP_MINFO_FUNCTION(xdebug);
65
66
67 PHP_FUNCTION(xdebug_get_function_stack);
e47e77b @derickr - Added xdebug_call_class() as addition to xdebug_call_function().
authored
68 PHP_FUNCTION(xdebug_call_class);
6c74074 @derickr - Implement userland functions
authored
69 PHP_FUNCTION(xdebug_call_function);
70 PHP_FUNCTION(xdebug_call_file);
71 PHP_FUNCTION(xdebug_call_line);
cde9bba @derickr - Add ini_setting and functions to enable and disable showing stacktr…
authored
72
ffd968a @derickr - Add fancy var dumping (this overrides the default var_dump() in PHP)
authored
73 PHP_FUNCTION(xdebug_var_dump);
74
cde9bba @derickr - Add ini_setting and functions to enable and disable showing stacktr…
authored
75 PHP_FUNCTION(xdebug_enable);
76 PHP_FUNCTION(xdebug_disable);
77 PHP_FUNCTION(xdebug_is_enabled);
78
b5be71c @derickr - srm_llist > xdebug_llist
authored
79 PHP_FUNCTION(xdebug_start_trace);
80 PHP_FUNCTION(xdebug_stop_trace);
81 PHP_FUNCTION(xdebug_get_function_trace);
5736ba1 @derickr - Renamed xdebug_get_function_trace() to xdebug_dump_function_trace().
authored
82 PHP_FUNCTION(xdebug_dump_function_trace);
d63d7ee @derickr - Added dumping of superglobals (patch by Harald Radi <phanto@php.net>).
authored
83 PHP_FUNCTION(xdebug_dump_superglobals);
b5be71c @derickr - srm_llist > xdebug_llist
authored
84
068edbc @derickr - Implemented the 'eval' command with which you can set and get varia…
authored
85 PHP_FUNCTION(xdebug_set_error_handler);
86
58d605c @derickr - Disable xdebug_memory_usage() when memory_limit was not compiled in.
authored
87 #if MEMORY_LIMIT
1dd5909 @derickr - Implemented xdebug_memory_usage() which returns the memory in use b…
authored
88 PHP_FUNCTION(xdebug_memory_usage);
58d605c @derickr - Disable xdebug_memory_usage() when memory_limit was not compiled in.
authored
89 #endif
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
90
dc202b9 @iliaal by xdebug_profiler.c. Moved the function declarations to php_xdebug.h
iliaal authored
91 void xdebug_start_trace();
92 void xdebug_stop_trace();
93
eedd44b @derickr - Implemented MUCH better parameter tracing for user defined functions
authored
94 typedef struct xdebug_var {
95 char *name;
96 char *value;
97 } xdebug_var;
98
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
99 #define XFUNC_UNKNOWN 0
100 #define XFUNC_NORMAL 1
101 #define XFUNC_STATIC_MEMBER 2
102 #define XFUNC_MEMBER 3
95487f4 @derickr - Implemented superior way of getting function names
authored
103 #define XFUNC_NEW 4
104 #define XFUNC_EVAL 5
105 #define XFUNC_INCLUDE 6
106 #define XFUNC_INCLUDE_ONCE 7
107 #define XFUNC_REQUIRE 8
108 #define XFUNC_REQUIRE_ONCE 9
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
109
2983739 @derickr - Implemented the list, print, show, step and pwd commands.
authored
110 #define XDEBUG_IS_FUNCTION(f) (f == XFUNC_NORMAL || f == XFUNC_STATIC_MEMBER || f == XFUNC_MEMBER)
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
111
d1e4fae @iliaal - Added profiling support to xdebug. This introduces 3 new functions,
iliaal authored
112 #define XDEBUG_REGISTER_LONG_CONSTANT(__c) REGISTER_LONG_CONSTANT(#__c, __c, CONST_CS|CONST_PERSISTENT)
113
612d80b @derickr - Implemented infrastructure for JIT and REQ debugging
authored
114 #define XDEBUG_NONE 0
115 #define XDEBUG_JIT 1
116 #define XDEBUG_REQ 2
117
2983739 @derickr - Implemented the list, print, show, step and pwd commands.
authored
118 #define XDEBUG_BREAK 1
119 #define XDEBUG_STEP 2
120
cad7002 @derickr - Fixed problem with breakpoints on internal functions.
authored
121 #define XDEBUG_INTERNAL 1
122 #define XDEBUG_EXTERNAL 2
123
4208fea @iliaal - Separated to profiling sorting/analysis code from the output code, …
iliaal authored
124 #define XDEBUG_MAX_FUNCTION_LEN 1024
125
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
126 typedef struct xdebug_func {
127 char *class;
128 char *function;
129 int type;
130 int internal;
131 } xdebug_func;
132
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
133 typedef struct function_stack_entry {
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
134 xdebug_func function;
cad7002 @derickr - Fixed problem with breakpoints on internal functions.
authored
135 int user_defined;
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
136
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
137 char *filename;
138 int lineno;
eedd44b @derickr - Implemented MUCH better parameter tracing for user defined functions
authored
139
140 int arg_done;
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
141 int varc;
eedd44b @derickr - Implemented MUCH better parameter tracing for user defined functions
authored
142 xdebug_var vars[20];
143
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
144 unsigned int memory;
145 double time;
97dc212 @derickr - Implement variable function names.
authored
146
2983739 @derickr - Implemented the list, print, show, step and pwd commands.
authored
147 xdebug_hash *used_vars;
148
4208fea @iliaal - Separated to profiling sorting/analysis code from the output code, …
iliaal authored
149 int level;
150 int refcount;
151
d1e4fae @iliaal - Added profiling support to xdebug. This introduces 3 new functions,
iliaal authored
152 /* used for profiling */
153 double time_taken;
154 unsigned int f_calls;
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
155 } function_stack_entry;
156
157 ZEND_BEGIN_MODULE_GLOBALS(xdebug)
b5be71c @derickr - srm_llist > xdebug_llist
authored
158 int level;
159 xdebug_llist *stack;
160 xdebug_llist *trace;
161 int max_nesting_level;
162 zend_bool default_enable;
f2394ea @derickr - Added xdebug.collect_params setting. If this setting is on (the def…
authored
163 zend_bool collect_params;
39f6e83 @derickr - Added automatic starting of function traces (xdebug.auto_trace, def…
authored
164 zend_bool auto_trace;
b5be71c @derickr - srm_llist > xdebug_llist
authored
165 zend_bool do_trace;
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
166 char *manual_url;
5736ba1 @derickr - Renamed xdebug_get_function_trace() to xdebug_dump_function_trace().
authored
167 FILE *trace_file;
068edbc @derickr - Implemented the 'eval' command with which you can set and get varia…
authored
168 char *error_handler;
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
169
72bcfe1 @derickr - Added code coverage, enable with xdebug_start_code_coverage(), disa…
authored
170 /* used for code coverage */
171 zend_bool do_code_coverage;
172 xdebug_hash *code_coverage;
173
d1e4fae @iliaal - Added profiling support to xdebug. This introduces 3 new functions,
iliaal authored
174 /* used for profiling */
175 double total_execution_time;
176 double total_compiling_time;
177 zend_bool do_profile;
178 zend_bool profiler_trace;
179 FILE *profile_file;
60db291 @iliaal - Added automatic profiling.
iliaal authored
180 zend_bool auto_profile;
181 char *output_dir;
182 int auto_profile_mode;
d1e4fae @iliaal - Added profiling support to xdebug. This introduces 3 new functions,
iliaal authored
183
d63d7ee @derickr - Added dumping of superglobals (patch by Harald Radi <phanto@php.net>).
authored
184 /* superglobals */
185 zend_bool dump_once;
186 zend_bool dump_undefined;
187 zend_bool dumped;
188 xdebug_llist server;
189 xdebug_llist get;
190 xdebug_llist post;
191 xdebug_llist cookie;
192 xdebug_llist files;
193 xdebug_llist env;
194 xdebug_llist request;
195 xdebug_llist session;
196
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
197 /* remote settings */
198 zend_bool remote_enable; /* 0 */
b4ee52a @derickr - Update portnumber on the server side too
authored
199 int remote_port; /* 17869 */
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
200 char *remote_host; /* localhost */
612d80b @derickr - Implemented infrastructure for JIT and REQ debugging
authored
201 int remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
202 char *remote_handler; /* php3, gdb */
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
203
204 /* remote debugging globals */
205 zend_bool remote_enabled;
276f139 @derickr - Change socket to contexts
authored
206 xdebug_con context;
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
207 ZEND_END_MODULE_GLOBALS(xdebug)
208
209 #ifdef ZTS
210 #define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
211 #else
212 #define XG(v) (xdebug_globals.v)
213 #endif
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
214
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
215 #endif
216
217
218 /*
219 * Local variables:
220 * tab-width: 4
221 * c-basic-offset: 4
222 * indent-tabs-mode: t
223 * End:
224 */
Something went wrong with that request. Please try again.