Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 271 lines (226 sloc) 7.951 kb
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
1 /*
2 +----------------------------------------------------------------------+
b66d5be @derickr - Licence update. This change only renames "PHP Licence" to "Xdebug L…
authored
3 | Xdebug |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
4 +----------------------------------------------------------------------+
8544a7f @derickr - 2007 baby.
authored
5 | Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007 Derick Rethans |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
6 +----------------------------------------------------------------------+
b66d5be @derickr - Licence update. This change only renames "PHP Licence" to "Xdebug L…
authored
7 | This source file is subject to version 1.0 of the Xdebug license, |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
8 | that is bundled with this package in the file LICENSE, and is |
9 | available at through the world-wide-web at |
b66d5be @derickr - Licence update. This change only renames "PHP Licence" to "Xdebug L…
authored
10 | http://xdebug.derickrethans.nl/license.php |
11 | If you did not receive a copy of the Xdebug license and are unable |
12 | to obtain it through the world-wide-web, please send a note to |
13 | xdebug@derickrethans.nl so we can mail you a copy immediately. |
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
14 +----------------------------------------------------------------------+
637bd81 @derickr - Email update
authored
15 | Authors: Derick Rethans <derick@xdebug.org> |
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
5c055b8 @derickr - Added the XML writer to config.m4
authored
22 #define XDEBUG_NAME "Xdebug"
2168f50 @derickr - HEAD is now 2.1.0-dev.
authored
23 #define XDEBUG_VERSION "2.1.0-dev"
5c055b8 @derickr - Added the XML writer to config.m4
authored
24 #define XDEBUG_AUTHOR "Derick Rethans"
2d956d6 @derickr - Go with RC3.
authored
25 #define XDEBUG_COPYRIGHT "Copyright (c) 2002-2007 by Derick Rethans"
5c055b8 @derickr - Added the XML writer to config.m4
authored
26 #define XDEBUG_URL "http://xdebug.org"
87f58a5 @derickr - Added "bt" command to get backtraces
authored
27
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
28 #include "php.h"
6005ed2 @derickr - Make it compile under ZTS mode
authored
29
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
30 #include "xdebug_handlers.h"
2983739 @derickr - Implemented the list, print, show, step and pwd commands.
authored
31 #include "xdebug_hash.h"
b5be71c @derickr - srm_llist > xdebug_llist
authored
32 #include "xdebug_llist.h"
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
33
34 extern zend_module_entry xdebug_module_entry;
35 #define phpext_xdebug_ptr &xdebug_module_entry
36
4103a9b @iliaal - Added another profiling mode, which can be accessed via
iliaal authored
37 #define MICRO_IN_SEC 1000000.00
38
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
39 #ifdef PHP_WIN32
40 #define PHP_XDEBUG_API __declspec(dllexport)
41 #else
42 #define PHP_XDEBUG_API
43 #endif
44
45 #ifdef ZTS
46 #include "TSRM.h"
47 #endif
48
8621e5e @derickr - Added header collection functionality and the xdebug_get_headers() …
authored
49 #include "main/SAPI.h"
50
f4787bc @derickr - Let's see if this makes it compile then.
authored
51 #if MEMORY_LIMIT
032b57f - Fixed compile failures with PHP 5.2
Jani Taskinen authored
52 # define HAVE_PHP_MEMORY_USAGE 1
04d0208 @derickr - Fixed memory tracking as memory_limit is always enabled in PHP 5.2.…
authored
53 #elif PHP_VERSION_ID >= 50201
54 # define HAVE_PHP_MEMORY_USAGE 1
f4787bc @derickr - Let's see if this makes it compile then.
authored
55 #else
56 # define HAVE_PHP_MEMORY_USAGE 0
57 #endif
58
59 #if PHP_VERSION_ID >= 50200
4b32de9 @derickr - Fixed bug #219: Memory usage delta in traces don't work on PHP 5.2.0.
authored
60 # define XG_MEMORY_USAGE() zend_memory_usage(0 TSRMLS_CC)
61 # define XG_MEMORY_PEAK_USAGE() zend_memory_peak_usage(0 TSRMLS_CC)
032b57f - Fixed compile failures with PHP 5.2
Jani Taskinen authored
62 #else
63 # define XG_MEMORY_USAGE() AG(allocated_memory)
64 # define XG_MEMORY_PEAK_USAGE() AG(allocated_memory_peak)
65 #endif
66
5a1d579 @derickr - Added some workarounds that dmitry mentioned, but don't work - so we
authored
67 #if PHP_VERSION_ID >= 50300
68 # define XG_INIT_SYMBOL_TABLE // if (!EG(active_symbol_table)) { zend_rebuild_symbol_table(TSRMLS_C); }
69 # define XG_INIT_SYMBOL_TABLE
70 #else
71 # define XG_INIT_SYMBOL_TABLE
72 #endif
73
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
74 PHP_MINIT_FUNCTION(xdebug);
75 PHP_MSHUTDOWN_FUNCTION(xdebug);
76 PHP_RINIT_FUNCTION(xdebug);
77 PHP_RSHUTDOWN_FUNCTION(xdebug);
78 PHP_MINFO_FUNCTION(xdebug);
415d1ee @derickr - Added the xdebug_get_tracefile_name() function to retrieve the name
authored
79 ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xdebug);
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
80
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
81 /* call stack functions */
d2c7573 @derickr - Added xdebug_get_stack_depth() to return the current stack depth le…
authored
82 PHP_FUNCTION(xdebug_get_stack_depth);
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
83 PHP_FUNCTION(xdebug_get_function_stack);
a83c092 @derickr - Added xdebug_get_formatted_function_stack().
authored
84 PHP_FUNCTION(xdebug_get_formatted_function_stack);
22604b8 @derickr - Added the xdebug_print_function_trace() function to display a stack…
authored
85 PHP_FUNCTION(xdebug_print_function_stack);
9e09b48 @derickr - Implemented FR #153: xdebug_get_declared_vars().
authored
86 PHP_FUNCTION(xdebug_get_declared_vars);
e47e77b @derickr - Added xdebug_call_class() as addition to xdebug_call_function().
authored
87 PHP_FUNCTION(xdebug_call_class);
6c74074 @derickr - Implement userland functions
authored
88 PHP_FUNCTION(xdebug_call_function);
89 PHP_FUNCTION(xdebug_call_file);
90 PHP_FUNCTION(xdebug_call_line);
cde9bba @derickr - Add ini_setting and functions to enable and disable showing stacktr…
authored
91
dc16630 @derickr - Fixed bug #111: xdebug does not ignore set_time_limit() function du…
authored
92 PHP_FUNCTION(xdebug_set_time_limit);
93
ffd968a @derickr - Add fancy var dumping (this overrides the default var_dump() in PHP)
authored
94 PHP_FUNCTION(xdebug_var_dump);
ee3797c @derickr - Added a function "xdebug_debug_zval" to debug zvals by printing its…
authored
95 PHP_FUNCTION(xdebug_debug_zval);
cf0a06a @derickr - Added xdebug_debug_zval_stdout().
authored
96 PHP_FUNCTION(xdebug_debug_zval_stdout);
ffd968a @derickr - Add fancy var dumping (this overrides the default var_dump() in PHP)
authored
97
50392dc @derickr - Put back the disabling of stack traces - apperently people were rel…
authored
98 /* activation functions */
99 PHP_FUNCTION(xdebug_enable);
100 PHP_FUNCTION(xdebug_disable);
101 PHP_FUNCTION(xdebug_is_enabled);
102
01c4f12 @derickr - Added FR #5: xdebug_break() function which interupts the script for…
authored
103 /* breaking functions */
104 PHP_FUNCTION(xdebug_break);
105
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
106 /* tracing functions */
b5be71c @derickr - srm_llist > xdebug_llist
authored
107 PHP_FUNCTION(xdebug_start_trace);
108 PHP_FUNCTION(xdebug_stop_trace);
415d1ee @derickr - Added the xdebug_get_tracefile_name() function to retrieve the name
authored
109 PHP_FUNCTION(xdebug_get_tracefile_name);
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
110
e86978e @derickr - Added the xdebug_start_error_collection(), xdebug_stop_error_collec…
authored
111 /* error collecting functions */
112 PHP_FUNCTION(xdebug_start_error_collection);
113 PHP_FUNCTION(xdebug_stop_error_collection);
114 PHP_FUNCTION(xdebug_get_collected_errors);
115
be44b25 - Added xdebug_get_profile_filename() function which returns the curr…
Jani Taskinen authored
116 /* profiling functions */
613a7c1 profile -> profiler (consistent)
Jani Taskinen authored
117 PHP_FUNCTION(xdebug_get_profiler_filename);
75960dc @derickr - Added profiling aggregation functions (patch by Andrei Zmievski)
authored
118 PHP_FUNCTION(xdebug_dump_aggr_profiling_data);
119 PHP_FUNCTION(xdebug_clear_aggr_profiling_data);
be44b25 - Added xdebug_get_profile_filename() function which returns the curr…
Jani Taskinen authored
120
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
121 /* misc functions */
d63d7ee @derickr - Added dumping of superglobals (patch by Harald Radi <phanto@php.net>).
authored
122 PHP_FUNCTION(xdebug_dump_superglobals);
8621e5e @derickr - Added header collection functionality and the xdebug_get_headers() …
authored
123 PHP_FUNCTION(xdebug_get_headers);
032b57f - Fixed compile failures with PHP 5.2
Jani Taskinen authored
124 #if HAVE_PHP_MEMORY_USAGE
1dd5909 @derickr - Implemented xdebug_memory_usage() which returns the memory in use b…
authored
125 PHP_FUNCTION(xdebug_memory_usage);
b1efad6 @derickr - Removed profiler code, and lay foundation for new code.
authored
126 PHP_FUNCTION(xdebug_peak_memory_usage);
58d605c @derickr - Disable xdebug_memory_usage() when memory_limit was not compiled in.
authored
127 #endif
f192a9b @derickr - Added the xdebug_time_index() function.
authored
128 PHP_FUNCTION(xdebug_time_index);
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
129
130 ZEND_BEGIN_MODULE_GLOBALS(xdebug)
5c055b8 @derickr - Added the XML writer to config.m4
authored
131 int status;
132 int reason;
133
996d335 @derickr - Fixed bug #93: Crash in lookup_hostname on x86_64
authored
134 long level;
b5be71c @derickr - srm_llist > xdebug_llist
authored
135 xdebug_llist *stack;
996d335 @derickr - Fixed bug #93: Crash in lookup_hostname on x86_64
authored
136 long max_nesting_level;
50392dc @derickr - Put back the disabling of stack traces - apperently people were rel…
authored
137 zend_bool default_enable;
8e17318 @derickr - Added a new setting xdebug.show_mem_delta to show differences between
authored
138 zend_bool collect_includes;
f87873a @derickr - Fixed bug #301: Loading would cause SIGBUS on Solaris 10 SPARC. (Pa…
authored
139 long collect_params;
1b40076 @derickr - Implemented showing returng values in traces. The xdebug.collect_re…
authored
140 zend_bool collect_return;
6651158 @derickr - Added the xdebug.collect_vars setting to tell Xdebug to collect
authored
141 zend_bool collect_vars;
657ff72 @derickr - Added the new setting "xdebug.collect_assignments" which enables th…
authored
142 zend_bool collect_assignments;
b1efad6 @derickr - Removed profiler code, and lay foundation for new code.
authored
143 zend_bool extended_info;
5c3e52b @derickr - Turn the display of a stack trace whenever an exception occurs into…
authored
144 zend_bool show_ex_trace;
b1efad6 @derickr - Removed profiler code, and lay foundation for new code.
authored
145 zend_bool show_local_vars;
8e17318 @derickr - Added a new setting xdebug.show_mem_delta to show differences between
authored
146 zend_bool show_mem_delta;
e2b429e @derickr - Add support for classnames, variable include files and variable fun…
authored
147 char *manual_url;
455963f @derickr - Let the time index start from the beginning of the *script* and not…
authored
148 double start_time;
9bc776f @derickr - Implemented "bt full" which shows a full stack trace including local
authored
149 HashTable *active_symbol_table;
caf3aea @derickr - Fixed bug #283: Xdebug always return $this with the value of last s…
authored
150 zend_execute_data *active_execute_data;
8e17318 @derickr - Added a new setting xdebug.show_mem_delta to show differences between
authored
151 unsigned int prev_memory;
99178ae @derickr - Implemented FR #244: Be able to click on filename in the error report
authored
152 char *file_link_format;
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
153
de3c62b @derickr - Added the xdebug.overload_var_dump setting which allows you to turn…
authored
154 zend_bool overload_var_dump;
155 zend_bool var_dump_overloaded;
27a1481 @derickr - Fixed bug #171: set_time_limit stack overflow on 2nd request.
authored
156 void (*orig_var_dump_func)(INTERNAL_FUNCTION_PARAMETERS);
996f387 @derickr - The zif_ trick doesn't work on Windows, so work around it by storing
authored
157 void (*orig_set_time_limit_func)(INTERNAL_FUNCTION_PARAMETERS);
158
b1efad6 @derickr - Removed profiler code, and lay foundation for new code.
authored
159 FILE *trace_file;
160 zend_bool do_trace;
161 zend_bool auto_trace;
e404565 @derickr - Changed trace file naming: xdebug.trace_output_dir is now used to c…
authored
162 char *trace_output_dir;
163 char *trace_output_name;
bd994d0 @derickr - Added a new php.ini setting "xdebug.trace_options" to configure extra
authored
164 long trace_options;
3272c98 @derickr - Added a computerized trace format for easier parsing by external pr…
authored
165 long trace_format;
415d1ee @derickr - Added the xdebug_get_tracefile_name() function to retrieve the name
authored
166 char *tracefile_name;
b8b01e0 @derickr - Fixed bug #181: Xdebug doesn't handle uncaught exception output cor…
authored
167 char *last_exception_trace;
ea16bb3 @derickr - Fixed a crash bug when using eval() and xdebug.collect_includes ena…
authored
168 char *last_eval_statement;
b1efad6 @derickr - Removed profiler code, and lay foundation for new code.
authored
169
ea1f746 @derickr - Partially implemented FR #50: Resource limiting for variable displa…
authored
170 /* variable dumping limitation settings */
171 long display_max_children;
172 long display_max_data;
173 long display_max_depth;
174
72bcfe1 @derickr - Added code coverage, enable with xdebug_start_code_coverage(), disa…
authored
175 /* used for code coverage */
176 zend_bool do_code_coverage;
177 xdebug_hash *code_coverage;
df2814b @derickr - Fixed the exit handler hook to use the new "5.1" way of handling it…
authored
178 zend_bool code_coverage_unused;
2bca68e @derickr - Implemented dead code analysis that should give much better code co…
authored
179 zend_bool code_coverage_dead_code_analysis;
46c3439 @derickr - Implemented function_counter
authored
180 unsigned int function_count;
9e76e80 @derickr - MF20: Improve code coverage gathering performace by 1000%.
authored
181 int reserved_offset;
72bcfe1 @derickr - Added code coverage, enable with xdebug_start_code_coverage(), disa…
authored
182
e86978e @derickr - Added the xdebug_start_error_collection(), xdebug_stop_error_collec…
authored
183 /* used for collection errors */
184 zend_bool do_collect_errors;
185 xdebug_llist *collected_errors;
186
d63d7ee @derickr - Added dumping of superglobals (patch by Harald Radi <phanto@php.net>).
authored
187 /* superglobals */
d5df3e3 @derickr - Fixed some layout issues.
authored
188 zend_bool dump_globals;
d63d7ee @derickr - Added dumping of superglobals (patch by Harald Radi <phanto@php.net>).
authored
189 zend_bool dump_once;
190 zend_bool dump_undefined;
191 zend_bool dumped;
192 xdebug_llist server;
193 xdebug_llist get;
194 xdebug_llist post;
195 xdebug_llist cookie;
196 xdebug_llist files;
197 xdebug_llist env;
198 xdebug_llist request;
199 xdebug_llist session;
200
8621e5e @derickr - Added header collection functionality and the xdebug_get_headers() …
authored
201 /* headers */
202 xdebug_llist *headers;
203 int (*orig_header_handler)(sapi_header_struct *h, sapi_headers_struct *s TSRMLS_DC);
204
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
205 /* remote settings */
206 zend_bool remote_enable; /* 0 */
996d335 @derickr - Fixed bug #93: Crash in lookup_hostname on x86_64
authored
207 long remote_port; /* 9000 */
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
208 char *remote_host; /* localhost */
204edff @derickr - Fixed bug #93: Crash on x86_64
authored
209 long remote_mode; /* XDEBUG_NONE, XDEBUG_JIT, XDEBUG_REQ */
ab64e66 @derickr - Add dbgp handler files, which do currently nothing yet
authored
210 char *remote_handler; /* php3, gdb, dbgp */
36301bc @derickr - Added request #88: Make the url parameter XDEBUG_SESSION_START opti…
authored
211 zend_bool remote_autostart; /* Disables the requirement for XDEBUG_SESSION_START */
55317fe @derickr - Added the xdebug.remote_log setting that allows you to log debugger
authored
212 char *remote_log; /* Filename to log protocol communication to */
213 FILE *remote_log_file; /* File handler for protocol log */
c12266f @derickr - Added the xdebug.remote_cookie_expire_time that controls the length…
authored
214 long remote_cookie_expire_time; /* Expire time for the remote-session cookie */
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
215
f041de3 @mixedpuppy - Fix returning text nodes that contain html tags and such
mixedpuppy authored
216 char *ide_key; /* from environment, USER, USERNAME or empty */
217
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
218 /* remote debugging globals */
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
219 zend_bool remote_enabled;
e2e05d3 @derickr - Fixed problems with using 'eval' and breakpoints at the same time. The
authored
220 zend_bool breakpoints_allowed;
cb87cbc @derickr - Fixed time indices in xdebug_get_function_trace
authored
221 xdebug_con context;
5c055b8 @derickr - Added the XML writer to config.m4
authored
222 unsigned int breakpoint_count;
e3b7724 @derickr - Implemented FR #210: Add a way to stop the debug session without ha…
authored
223 unsigned int no_exec;
46c3439 @derickr - Implemented function_counter
authored
224
76c894e @derickr - Re-implemented profiling support. Xdebug outputs information the sa…
authored
225 /* profiler settings */
226 zend_bool profiler_enable;
227 char *profiler_output_dir;
be39b3e @derickr - Added internal xdebug_crc32() function. (Copy from PHP sources).
authored
228 char *profiler_output_name; /* "pid" or "crc32" */
0d77c16 @derickr - Fixed bug #108: log_only still displays some text for errors in inc…
authored
229 zend_bool profiler_enable_trigger;
4e08cb3 @derickr - Added FR #148: Option to append to cachegrind files, instead of ove…
authored
230 zend_bool profiler_append;
76c894e @derickr - Re-implemented profiling support. Xdebug outputs information the sa…
authored
231
232 /* profiler globals */
233 zend_bool profiler_enabled;
234 FILE *profile_file;
be44b25 - Added xdebug_get_profile_filename() function which returns the curr…
Jani Taskinen authored
235 char *profile_filename;
76c894e @derickr - Re-implemented profiling support. Xdebug outputs information the sa…
authored
236
46c3439 @derickr - Implemented function_counter
authored
237 /* DBGp globals */
238 char *lastcmd;
239 char *lasttransid;
ccbaa3d @mixedpuppy - magic_cookie is not necessary for remote debugging
mixedpuppy authored
240
241 /* output redirection */
242 php_output_globals stdio;
243 int stdout_redirected;
244 int stderr_redirected;
245 int stdin_redirected;
246
75960dc @derickr - Added profiling aggregation functions (patch by Andrei Zmievski)
authored
247 /* aggregate profiling */
248 HashTable aggr_calls;
249 zend_bool profiler_aggregate;
250
ecfd2c2 @derickr - Added scream support (xdebug.scream) that makes the @ operator to b…
authored
251 /* scream */
252 zend_bool do_scream;
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
253 ZEND_END_MODULE_GLOBALS(xdebug)
254
255 #ifdef ZTS
256 #define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
257 #else
258 #define XG(v) (xdebug_globals.v)
259 #endif
930bdaa @derickr - Implemented remote debugger handler abstraction
authored
260
78749ee @derickr This commit was generated by cvs2svn to compensate for changes in r2,
authored
261 #endif
262
263
264 /*
265 * Local variables:
266 * tab-width: 4
267 * c-basic-offset: 4
268 * indent-tabs-mode: t
269 * End:
270 */
Something went wrong with that request. Please try again.