-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdebugger.h
More file actions
103 lines (82 loc) · 4.31 KB
/
debugger.h
File metadata and controls
103 lines (82 loc) · 4.31 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
/*
+----------------------------------------------------------------------+
| Xdebug |
+----------------------------------------------------------------------+
| Copyright (c) 2002-2023 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 |
| derick@xdebug.org so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#ifndef __XDEBUG_DEBUGGER_H__
#define __XDEBUG_DEBUGGER_H__
#include "com.h"
typedef struct _xdebug_debugger_globals_t {
int status;
int reason;
const char *lastcmd;
char *lasttransid;
zval *current_return_value;
zend_bool remote_connection_enabled;
zend_ulong remote_connection_pid;
zend_bool breakpoints_allowed;
zend_bool suppress_return_value_step;
zend_bool detached;
xdebug_con context;
unsigned int breakpoint_count;
unsigned int no_exec;
char *ide_key; /* As Xdebug uses it, from environment, USER, USERNAME or empty */
/* breakpoint resolving */
size_t function_count;
size_t class_count;
xdebug_hash *breakable_lines_map;
/* output redirection */
int stdout_mode;
} xdebug_debugger_globals_t;
typedef struct _xdebug_debugger_settings_t {
/* Cloud */
char *cloud_id;
char *cloud_shared_key;
/* Step Debugger */
zend_long client_port; /* 9003 */
char *client_host; /* localhost */
zend_bool discover_client_host; /* (try to) connect back to the HTTP requestor */
char *client_discovery_header; /* User configured header to check for forwarded IP address */
zend_long connect_timeout_ms; /* Timeout in MS for remote connections */
char *ide_key_setting; /* Set through php.ini and friends */
zend_bool on_demand_debugging_enabled; /* Enable on-demand debugging */
} xdebug_debugger_settings_t;
PHP_INI_MH(OnUpdateDebugMode);
void xdebug_init_debugger_globals(xdebug_debugger_globals_t *xg);
#define XDEBUG_RETURN_VALUE_VAR_NAME "__RETURN_VALUE"
#define XDEBUG_EXCEPTION_VALUE_VAR_NAME "__EXCEPTION"
#define XDEBUG_INTERMEDIATE_VALUE_VAR_NAME "__INTERMEDIATE_VALUE"
void xdebug_debugger_reset_ide_key(char *envval);
int xdebug_debugger_bailout_if_no_exec_requested(void);
void xdebug_debugger_set_program_name(zend_string *filename);
void xdebug_debugger_register_eval(function_stack_entry *fse);
void xdebug_debugger_restart_if_pid_changed(void);
xdebug_set *xdebug_debugger_get_breakable_lines_from_oparray(zend_op_array *opa);
int xdebug_do_eval(char *eval_string, zval *ret_zval, zend_string **return_message);
bool xdebug_debugger_check_evaled_code_zstr(zend_string *filename_in, zend_string **filename_out);
bool xdebug_debugger_check_evaled_code_xdebug_str(xdebug_str *filename_in, zend_string **filename_out);
void xdebug_debugger_set_has_line_breakpoints(function_stack_entry *fse);
int xdebug_debugger_map_remote_to_local(zend_string *remote_filename, int remote_lineno, xdebug_str **local_path, size_t *local_line, bool *must_free);
void xdebug_debugger_statement_call(zend_string *filename, int lineno);
void xdebug_debugger_throw_exception_hook(zend_object *exception, zval *file, zval *line, zval *code, char *code_str, zval *message);
void xdebug_debugger_error_cb(zend_string *error_filename, int error_lineno, int type, char *error_type_str, char *buffer);
void xdebug_debugger_handle_breakpoints(function_stack_entry *fse, int breakpoint_type, zval *return_value);
void xdebug_debugger_zend_startup(void);
void xdebug_debugger_zend_shutdown(void);
void xdebug_debugger_minit(void);
void xdebug_debugger_minfo(void);
void xdebug_debugger_rinit(void);
void xdebug_debugger_post_deactivate(void);
void xdebug_debugger_compile_file(zend_op_array *op_array);
PHP_FUNCTION(xdebug_break);
#endif