forked from xdebug/xdebug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xdebug_handlers.h
143 lines (120 loc) · 4.89 KB
/
xdebug_handlers.h
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
135
136
137
138
139
140
141
142
143
/*
+----------------------------------------------------------------------+
| Xdebug |
+----------------------------------------------------------------------+
| Copyright (c) 2002-2018 Derick Rethans |
+----------------------------------------------------------------------+
| This source file is subject to version 1.01 of the Xdebug license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| https://xdebug.org/license.php |
| If you did not receive a copy of the Xdebug license and are unable |
| to obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Derick Rethans <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef __HAVE_XDEBUG_HANDLERS_H__
#define __HAVE_XDEBUG_HANDLERS_H__
#include "php_xdebug.h"
#include "xdebug_llist.h"
#include "xdebug_hash.h"
#include "xdebug_private.h"
#include "usefulstuff.h"
typedef struct _xdebug_brk_admin xdebug_brk_admin;
typedef struct _xdebug_brk_info xdebug_brk_info;
typedef struct _xdebug_eval_info xdebug_eval_info;
typedef struct _xdebug_con xdebug_con;
typedef struct _xdebug_debug_list xdebug_debug_list;
typedef struct _xdebug_remote_handler xdebug_remote_handler;
typedef struct _xdebug_remote_handler_info xdebug_remote_handler_info;
struct _xdebug_debug_list {
char *last_file;
int last_line;
};
#define BREAKPOINT_TYPE_LINE 1
#define BREAKPOINT_TYPE_FUNCTION 2
#define BREAKPOINT_TYPE_EXCEPTION 4
struct _xdebug_brk_admin {
int id;
int type;
char *key;
};
struct _xdebug_con {
int socket;
void *options;
xdebug_remote_handler *handler;
fd_buf *buffer;
char *program_name;
xdebug_hash *breakpoint_list;
xdebug_hash *function_breakpoints;
xdebug_hash *eval_id_lookup;
int eval_id_sequence;
xdebug_llist *line_breakpoints;
xdebug_hash *exception_breakpoints;
xdebug_debug_list list;
int do_break;
int do_step;
int do_next;
int next_level;
int do_finish;
int finish_level;
int finish_func_nr;
int send_notifications;
int inhibit_notifications;
};
#define XDEBUG_HIT_DISABLED 0
#define XDEBUG_HIT_GREATER_EQUAL 1
#define XDEBUG_HIT_EQUAL 2
#define XDEBUG_HIT_MOD 3
#define XDEBUG_BRK_FUNC_CALL 1
#define XDEBUG_BRK_FUNC_RETURN 2
struct _xdebug_brk_info {
char *type;
char *classname;
char *functionname;
char *exceptionname;
int function_break_type; /* XDEBUG_BRK_FUNC_* */
char *file;
int file_len;
int lineno;
char *condition;
int disabled;
int temporary;
int hit_count;
int hit_value;
int hit_condition;
};
struct _xdebug_eval_info {
int id;
int refcount;
char *contents;
};
struct _xdebug_remote_handler {
/* Init / deinit */
int (*remote_init)(xdebug_con *h, int mode);
int (*remote_deinit)(xdebug_con *h);
/* Stack messages */
int (*remote_error)(xdebug_con *h, int type, char *exception_type, char *message, const char *location, const uint line, xdebug_llist *stack);
/* Breakpoints */
int (*remote_breakpoint)(xdebug_con *h, xdebug_llist *stack, char *file, long lineno, int type, char *exception, char *code, char *message);
/* Output redirection */
int (*remote_stream_output)(const char *string, unsigned int length TSRMLS_DC);
/* Notifications */
int (*remote_notification)(xdebug_con *h, const char *file, long lineno, int type, char *type_string, char *message TSRMLS_DC);
/* Eval ID registration and removal */
int (*register_eval_id)(xdebug_con *h, function_stack_entry *fse);
};
struct _xdebug_remote_handler_info {
const char *name;
const char *description;
xdebug_remote_handler handler;
};
xdebug_remote_handler* xdebug_handler_get(char* mode);
xdebug_remote_handler_info* xdebug_handlers_get(void);
void xdebug_brk_info_dtor(xdebug_brk_info *brk);
void xdebug_llist_brk_dtor(void *dummy, xdebug_brk_info *brk);
void xdebug_hash_brk_dtor(xdebug_brk_info *brk);
void xdebug_hash_eval_info_dtor(xdebug_eval_info *ei);
#endif