Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: XDEBUG_0_9_0
Fetching contributors…

Cannot retrieve contributors at this time

file 134 lines (105 sloc) 3.561 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
/*
+----------------------------------------------------------------------+
| PHP Version 4 |
+----------------------------------------------------------------------+
| Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Derick Rethans <derick@vl-srm.net> |
+----------------------------------------------------------------------+
*/

#ifndef PHP_XDEBUG_H
#define PHP_XDEBUG_H

#include "php.h"

#include "xdebug_llist.h"

extern zend_module_entry xdebug_module_entry;
#define phpext_xdebug_ptr &xdebug_module_entry

#ifdef PHP_WIN32
#define PHP_XDEBUG_API __declspec(dllexport)
#else
#define PHP_XDEBUG_API
#endif

#ifdef ZTS
#include "TSRM.h"
#endif

PHP_MINIT_FUNCTION(xdebug);
PHP_MSHUTDOWN_FUNCTION(xdebug);
PHP_RINIT_FUNCTION(xdebug);
PHP_RSHUTDOWN_FUNCTION(xdebug);
PHP_MINFO_FUNCTION(xdebug);


PHP_FUNCTION(xdebug_get_function_stack);
PHP_FUNCTION(xdebug_call_function);
PHP_FUNCTION(xdebug_call_file);
PHP_FUNCTION(xdebug_call_line);

PHP_FUNCTION(xdebug_enable);
PHP_FUNCTION(xdebug_disable);
PHP_FUNCTION(xdebug_is_enabled);

PHP_FUNCTION(xdebug_start_trace);
PHP_FUNCTION(xdebug_stop_trace);
PHP_FUNCTION(xdebug_get_function_trace);
PHP_FUNCTION(xdebug_dump_function_trace);

#if MEMORY_LIMIT
PHP_FUNCTION(xdebug_memory_usage);
#endif

typedef struct xdebug_var {
char *name;
char *value;
} xdebug_var;

#define XFUNC_UNKNOWN 0
#define XFUNC_NORMAL 1
#define XFUNC_STATIC_MEMBER 2
#define XFUNC_MEMBER 3

#define XFUNC_SET(e,t,c,f) (e)->function.type = t; (e)->function.class = estrdup (c); (e)->function.function = estrdup (f);
#define XFUNC_SET_DELAYED_F(e,t,c) (e)->function.type = t; (e)->function.class = estrdup (c); (e)->delayed_fname = 1;
#define XFUNC_SET_DELAYED_C(e,t,f) (e)->function.type = t; (e)->function.function = estrdup (f); (e)->delayed_cname = 1;

typedef struct xdebug_func {
char *class;
char *function;
int type;
int internal;
} xdebug_func;

typedef struct function_stack_entry {
xdebug_func function;

char *filename;
int lineno;

int arg_done;
int varc;
xdebug_var vars[20];

int delayed_fname;
int delayed_cname;
int delayed_include;

unsigned int memory;
double time;

int level;
int refcount;
} function_stack_entry;


ZEND_BEGIN_MODULE_GLOBALS(xdebug)
int level;
xdebug_llist *stack;
xdebug_llist *trace;
int max_nesting_level;
zend_bool default_enable;
zend_bool do_trace;
char *manual_url;
FILE *trace_file;
ZEND_END_MODULE_GLOBALS(xdebug)


#ifdef ZTS
#define XG(v) TSRMG(xdebug_globals_id, zend_xdebug_globals *, v)
#else
#define XG(v) (xdebug_globals.v)
#endif

#endif


/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* indent-tabs-mode: t
* End:
*/
Something went wrong with that request. Please try again.