2013-11-10 10:46:18 +00:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2015-03-13 09:09:42 +00:00
|
|
|
| PHP Version 7 |
|
2013-11-10 10:46:18 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2016-01-01 17:19:27 +00:00
|
|
|
| Copyright (c) 1997-2016 The PHP Group |
|
2013-11-10 10:46:18 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available through the world-wide-web at the following url: |
|
|
|
|
| http://www.php.net/license/3_01.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. |
|
|
|
|
+----------------------------------------------------------------------+
|
2013-11-17 12:40:51 +00:00
|
|
|
| Authors: Felipe Pena <felipe@php.net> |
|
2013-11-10 10:46:18 +00:00
|
|
|
| Authors: Joe Watkins <joe.watkins@live.co.uk> |
|
2013-12-23 22:55:07 +00:00
|
|
|
| Authors: Bob Weinand <bwoebi@php.net> |
|
2013-11-10 10:46:18 +00:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
2013-11-10 18:06:41 +00:00
|
|
|
|
|
|
|
#ifndef PHPDBG_H
|
|
|
|
#define PHPDBG_H
|
|
|
|
|
2013-11-23 17:56:16 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
# define PHPDBG_API __declspec(dllexport)
|
|
|
|
#elif defined(__GNUC__) && __GNUC__ >= 4
|
|
|
|
# define PHPDBG_API __attribute__ ((visibility("default")))
|
|
|
|
#else
|
|
|
|
# define PHPDBG_API
|
|
|
|
#endif
|
|
|
|
|
2014-10-25 11:01:17 +00:00
|
|
|
#ifndef PHP_WIN32
|
|
|
|
# include <stdint.h>
|
|
|
|
# include <stddef.h>
|
|
|
|
#else
|
2015-03-19 12:22:10 +00:00
|
|
|
# include "main/php_stdint.h"
|
2014-10-25 11:01:17 +00:00
|
|
|
#endif
|
2013-11-10 10:46:18 +00:00
|
|
|
#include "php.h"
|
|
|
|
#include "php_globals.h"
|
|
|
|
#include "php_variables.h"
|
2013-11-10 17:45:06 +00:00
|
|
|
#include "php_getopt.h"
|
2013-11-10 23:30:52 +00:00
|
|
|
#include "zend_builtin_functions.h"
|
|
|
|
#include "zend_extensions.h"
|
2013-11-10 10:46:18 +00:00
|
|
|
#include "zend_modules.h"
|
|
|
|
#include "zend_globals.h"
|
2013-11-10 23:30:52 +00:00
|
|
|
#include "zend_ini_scanner.h"
|
2013-11-10 10:46:18 +00:00
|
|
|
#include "zend_stream.h"
|
2016-07-12 22:37:25 +00:00
|
|
|
#include "zend_signal.h"
|
|
|
|
#if !defined(_WIN32) && !defined(ZEND_SIGNALS) && defined(HAVE_SIGNAL_H)
|
|
|
|
# include <signal.h>
|
2016-07-18 23:29:03 +00:00
|
|
|
#elif PHP_WIN32
|
|
|
|
# include "win32/signal.h"
|
2014-03-16 18:39:02 +00:00
|
|
|
#endif
|
2013-11-10 10:46:18 +00:00
|
|
|
#include "SAPI.h"
|
2013-11-12 12:10:53 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
2014-10-19 19:20:43 +00:00
|
|
|
# include <windows.h>
|
|
|
|
# include "config.w32.h"
|
|
|
|
# undef strcasecmp
|
|
|
|
# undef strncasecmp
|
2015-01-03 09:22:58 +00:00
|
|
|
# define strcasecmp _stricmp
|
|
|
|
# define strncasecmp _strnicmp
|
2013-11-12 12:10:53 +00:00
|
|
|
#else
|
2014-10-19 19:20:43 +00:00
|
|
|
# include "php_config.h"
|
2013-11-12 12:10:53 +00:00
|
|
|
#endif
|
|
|
|
#ifndef O_BINARY
|
|
|
|
# define O_BINARY 0
|
|
|
|
#endif
|
2013-11-10 10:46:18 +00:00
|
|
|
#include "php_main.h"
|
|
|
|
|
|
|
|
#ifdef ZTS
|
|
|
|
# include "TSRM.h"
|
|
|
|
#endif
|
|
|
|
|
2014-10-24 17:29:50 +00:00
|
|
|
#undef zend_hash_str_add
|
2014-12-16 10:45:02 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
#define zend_hash_str_add(...) \
|
|
|
|
_zend_hash_str_add(__VA_ARGS__ ZEND_FILE_LINE_CC)
|
|
|
|
#else
|
2014-10-24 17:29:50 +00:00
|
|
|
#define zend_hash_str_add_tmp(ht, key, len, pData) \
|
|
|
|
_zend_hash_str_add(ht, key, len, pData ZEND_FILE_LINE_CC)
|
|
|
|
#define zend_hash_str_add(...) zend_hash_str_add_tmp(__VA_ARGS__)
|
2014-12-16 10:45:02 +00:00
|
|
|
#endif
|
2014-10-24 17:29:50 +00:00
|
|
|
|
2014-10-04 21:21:34 +00:00
|
|
|
#ifdef HAVE_LIBREADLINE
|
2014-10-19 19:20:43 +00:00
|
|
|
# include <readline/readline.h>
|
|
|
|
# include <readline/history.h>
|
2013-11-12 04:20:14 +00:00
|
|
|
#endif
|
2014-06-23 08:17:43 +00:00
|
|
|
#ifdef HAVE_LIBEDIT
|
2014-10-19 19:20:43 +00:00
|
|
|
# include <editline/readline.h>
|
2014-06-23 08:17:43 +00:00
|
|
|
#endif
|
2013-11-12 04:20:14 +00:00
|
|
|
|
2014-09-10 13:53:40 +00:00
|
|
|
/* {{{ remote console headers */
|
|
|
|
#ifndef _WIN32
|
|
|
|
# include <sys/socket.h>
|
|
|
|
# include <sys/un.h>
|
|
|
|
# include <sys/select.h>
|
|
|
|
# include <sys/types.h>
|
2014-10-19 19:20:43 +00:00
|
|
|
# include <netdb.h>
|
2014-09-10 13:53:40 +00:00
|
|
|
#endif /* }}} */
|
2013-11-17 21:01:41 +00:00
|
|
|
|
2014-09-09 00:15:33 +00:00
|
|
|
/* {{{ strings */
|
|
|
|
#define PHPDBG_NAME "phpdbg"
|
|
|
|
#define PHPDBG_AUTHORS "Felipe Pena, Joe Watkins and Bob Weinand" /* Ordered by last name */
|
2015-07-14 06:31:44 +00:00
|
|
|
#define PHPDBG_ISSUES "http://bugs.php.net/report.php"
|
|
|
|
#define PHPDBG_VERSION "0.5.0"
|
2014-09-09 00:15:33 +00:00
|
|
|
#define PHPDBG_INIT_FILENAME ".phpdbginit"
|
2014-10-07 11:08:30 +00:00
|
|
|
#define PHPDBG_DEFAULT_PROMPT "prompt>"
|
2014-09-09 00:15:33 +00:00
|
|
|
/* }}} */
|
|
|
|
|
2014-10-11 22:30:09 +00:00
|
|
|
/* Hey, apple. One shouldn't define *functions* from the standard C library as marcos. */
|
|
|
|
#ifdef memcpy
|
|
|
|
#define memcpy_tmp(...) memcpy(__VA_ARGS__)
|
|
|
|
#undef memcpy
|
|
|
|
#define memcpy(...) memcpy_tmp(__VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
|
2015-07-27 13:02:01 +00:00
|
|
|
#define quiet_write(...) ZEND_IGNORE_VALUE(write(__VA_ARGS__))
|
|
|
|
|
2014-09-10 13:53:40 +00:00
|
|
|
#if !defined(PHPDBG_WEBDATA_TRANSFER_H) && !defined(PHPDBG_WEBHELPER_H)
|
2014-06-08 20:34:30 +00:00
|
|
|
|
2013-11-10 10:46:18 +00:00
|
|
|
#ifdef ZTS
|
|
|
|
# define PHPDBG_G(v) TSRMG(phpdbg_globals_id, zend_phpdbg_globals *, v)
|
|
|
|
#else
|
|
|
|
# define PHPDBG_G(v) (phpdbg_globals.v)
|
|
|
|
#endif
|
|
|
|
|
2014-09-28 00:57:12 +00:00
|
|
|
#include "phpdbg_sigsafe.h"
|
2014-10-23 11:16:00 +00:00
|
|
|
#include "phpdbg_out.h"
|
2014-06-08 20:34:30 +00:00
|
|
|
#include "phpdbg_lexer.h"
|
2013-11-17 21:01:41 +00:00
|
|
|
#include "phpdbg_cmd.h"
|
2013-11-24 19:34:18 +00:00
|
|
|
#include "phpdbg_utils.h"
|
2013-12-15 14:05:50 +00:00
|
|
|
#include "phpdbg_btree.h"
|
2013-12-11 20:27:03 +00:00
|
|
|
#include "phpdbg_watch.h"
|
2014-10-26 19:43:49 +00:00
|
|
|
#include "phpdbg_bp.h"
|
2015-06-22 10:56:29 +00:00
|
|
|
#include "phpdbg_opcode.h"
|
2014-10-20 20:12:58 +00:00
|
|
|
#ifdef PHP_WIN32
|
|
|
|
# include "phpdbg_sigio_win32.h"
|
|
|
|
#endif
|
2013-11-17 21:01:41 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
int phpdbg_do_parse(phpdbg_param_t *stack, char *input);
|
2014-06-08 20:34:30 +00:00
|
|
|
|
2013-11-17 15:39:23 +00:00
|
|
|
#define PHPDBG_NEXT 2
|
|
|
|
#define PHPDBG_UNTIL 3
|
|
|
|
#define PHPDBG_FINISH 4
|
|
|
|
#define PHPDBG_LEAVE 5
|
2013-11-10 14:28:14 +00:00
|
|
|
|
2013-11-26 22:20:52 +00:00
|
|
|
/*
|
|
|
|
BEGIN: DO NOT CHANGE DO NOT CHANGE DO NOT CHANGE
|
|
|
|
*/
|
|
|
|
|
2013-11-12 01:24:53 +00:00
|
|
|
/* {{{ flags */
|
2014-10-26 19:43:49 +00:00
|
|
|
#define PHPDBG_HAS_FILE_BP (1ULL<<1)
|
|
|
|
#define PHPDBG_HAS_PENDING_FILE_BP (1ULL<<2)
|
|
|
|
#define PHPDBG_HAS_SYM_BP (1ULL<<3)
|
|
|
|
#define PHPDBG_HAS_OPLINE_BP (1ULL<<4)
|
|
|
|
#define PHPDBG_HAS_METHOD_BP (1ULL<<5)
|
|
|
|
#define PHPDBG_HAS_COND_BP (1ULL<<6)
|
|
|
|
#define PHPDBG_HAS_OPCODE_BP (1ULL<<7)
|
|
|
|
#define PHPDBG_HAS_FUNCTION_OPLINE_BP (1ULL<<8)
|
|
|
|
#define PHPDBG_HAS_METHOD_OPLINE_BP (1ULL<<9)
|
|
|
|
#define PHPDBG_HAS_FILE_OPLINE_BP (1ULL<<10) /* }}} */
|
2013-12-01 14:58:59 +00:00
|
|
|
|
2013-11-26 22:20:52 +00:00
|
|
|
/*
|
|
|
|
END: DO NOT CHANGE DO NOT CHANGE DO NOT CHANGE
|
|
|
|
*/
|
|
|
|
|
2014-10-26 19:43:49 +00:00
|
|
|
#define PHPDBG_IN_COND_BP (1ULL<<11)
|
|
|
|
#define PHPDBG_IN_EVAL (1ULL<<12)
|
2013-12-07 15:03:01 +00:00
|
|
|
|
2014-10-26 19:43:49 +00:00
|
|
|
#define PHPDBG_IS_STEPPING (1ULL<<13)
|
|
|
|
#define PHPDBG_STEP_OPCODE (1ULL<<14)
|
|
|
|
#define PHPDBG_IS_QUIET (1ULL<<15)
|
|
|
|
#define PHPDBG_IS_QUITTING (1ULL<<16)
|
|
|
|
#define PHPDBG_IS_COLOURED (1ULL<<17)
|
|
|
|
#define PHPDBG_IS_CLEANING (1ULL<<18)
|
|
|
|
#define PHPDBG_IS_RUNNING (1ULL<<19)
|
2013-12-07 15:03:01 +00:00
|
|
|
|
2014-10-26 19:43:49 +00:00
|
|
|
#define PHPDBG_IN_UNTIL (1ULL<<20)
|
|
|
|
#define PHPDBG_IN_FINISH (1ULL<<21)
|
|
|
|
#define PHPDBG_IN_LEAVE (1ULL<<22)
|
2014-04-20 17:55:44 +00:00
|
|
|
|
2014-10-26 19:43:49 +00:00
|
|
|
#define PHPDBG_IS_REGISTERED (1ULL<<23)
|
|
|
|
#define PHPDBG_IS_STEPONEVAL (1ULL<<24)
|
|
|
|
#define PHPDBG_IS_INITIALIZING (1ULL<<25)
|
|
|
|
#define PHPDBG_IS_SIGNALED (1ULL<<26)
|
|
|
|
#define PHPDBG_IS_INTERACTIVE (1ULL<<27)
|
2015-09-23 16:30:13 +00:00
|
|
|
#define PHPDBG_PREVENT_INTERACTIVE (1ULL<<28)
|
|
|
|
#define PHPDBG_IS_BP_ENABLED (1ULL<<29)
|
|
|
|
#define PHPDBG_IS_REMOTE (1ULL<<30)
|
|
|
|
#define PHPDBG_IS_DISCONNECTED (1ULL<<31)
|
|
|
|
#define PHPDBG_WRITE_XML (1ULL<<32)
|
2014-04-20 17:55:44 +00:00
|
|
|
|
2015-09-23 16:30:13 +00:00
|
|
|
#define PHPDBG_SHOW_REFCOUNTS (1ULL<<33)
|
2014-04-20 17:55:44 +00:00
|
|
|
|
2015-09-23 16:30:13 +00:00
|
|
|
#define PHPDBG_IN_SIGNAL_HANDLER (1ULL<<34)
|
2014-04-20 17:55:44 +00:00
|
|
|
|
2015-09-23 16:30:13 +00:00
|
|
|
#define PHPDBG_DISCARD_OUTPUT (1ULL<<35)
|
2014-04-14 17:37:31 +00:00
|
|
|
|
2015-10-18 14:08:04 +00:00
|
|
|
#define PHPDBG_HAS_PAGINATION (1ULL<<36)
|
|
|
|
|
2014-10-26 02:50:28 +00:00
|
|
|
#define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL | PHPDBG_IN_FINISH | PHPDBG_IN_LEAVE)
|
|
|
|
#define PHPDBG_BP_RESOLVE_MASK (PHPDBG_HAS_FUNCTION_OPLINE_BP | PHPDBG_HAS_METHOD_OPLINE_BP | PHPDBG_HAS_FILE_OPLINE_BP)
|
|
|
|
#define PHPDBG_BP_MASK (PHPDBG_HAS_FILE_BP | PHPDBG_HAS_SYM_BP | PHPDBG_HAS_METHOD_BP | PHPDBG_HAS_OPLINE_BP | PHPDBG_HAS_COND_BP | PHPDBG_HAS_OPCODE_BP | PHPDBG_HAS_FUNCTION_OPLINE_BP | PHPDBG_HAS_METHOD_OPLINE_BP | PHPDBG_HAS_FILE_OPLINE_BP)
|
|
|
|
#define PHPDBG_IS_STOPPING (PHPDBG_IS_QUITTING | PHPDBG_IS_CLEANING)
|
2013-12-09 10:15:16 +00:00
|
|
|
|
2015-10-18 14:08:04 +00:00
|
|
|
#define PHPDBG_PRESERVE_FLAGS_MASK (PHPDBG_SHOW_REFCOUNTS | PHPDBG_IS_STEPONEVAL | PHPDBG_IS_BP_ENABLED | PHPDBG_STEP_OPCODE | PHPDBG_IS_QUIET | PHPDBG_IS_COLOURED | PHPDBG_IS_REMOTE | PHPDBG_WRITE_XML | PHPDBG_IS_DISCONNECTED | PHPDBG_HAS_PAGINATION)
|
2013-12-09 10:15:16 +00:00
|
|
|
|
2013-11-13 22:18:20 +00:00
|
|
|
#ifndef _WIN32
|
2015-10-18 14:08:04 +00:00
|
|
|
# define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET | PHPDBG_IS_COLOURED | PHPDBG_IS_BP_ENABLED | PHPDBG_HAS_PAGINATION)
|
2013-11-13 22:18:20 +00:00
|
|
|
#else
|
2015-10-18 14:08:04 +00:00
|
|
|
# define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET | PHPDBG_IS_BP_ENABLED | PHPDBG_HAS_PAGINATION)
|
2013-11-13 22:18:20 +00:00
|
|
|
#endif /* }}} */
|
2013-11-12 01:24:53 +00:00
|
|
|
|
2013-11-22 16:15:24 +00:00
|
|
|
/* {{{ output descriptors */
|
|
|
|
#define PHPDBG_STDIN 0
|
|
|
|
#define PHPDBG_STDOUT 1
|
2013-11-24 19:34:18 +00:00
|
|
|
#define PHPDBG_STDERR 2
|
|
|
|
#define PHPDBG_IO_FDS 3 /* }}} */
|
2013-11-22 16:15:24 +00:00
|
|
|
|
2014-10-02 23:29:41 +00:00
|
|
|
#define phpdbg_try_access \
|
|
|
|
{ \
|
|
|
|
JMP_BUF *__orig_bailout = PHPDBG_G(sigsegv_bailout); \
|
|
|
|
JMP_BUF __bailout; \
|
|
|
|
\
|
|
|
|
PHPDBG_G(sigsegv_bailout) = &__bailout; \
|
|
|
|
if (SETJMP(__bailout) == 0) {
|
|
|
|
#define phpdbg_catch_access \
|
|
|
|
} else { \
|
|
|
|
PHPDBG_G(sigsegv_bailout) = __orig_bailout;
|
|
|
|
#define phpdbg_end_try_access() \
|
|
|
|
} \
|
|
|
|
PHPDBG_G(sigsegv_bailout) = __orig_bailout; \
|
|
|
|
}
|
|
|
|
|
2014-02-18 19:48:33 +00:00
|
|
|
|
2013-11-19 12:39:48 +00:00
|
|
|
/* {{{ structs */
|
2013-11-16 14:34:49 +00:00
|
|
|
ZEND_BEGIN_MODULE_GLOBALS(phpdbg)
|
2013-11-26 10:02:58 +00:00
|
|
|
HashTable bp[PHPDBG_BREAK_TABLES]; /* break points */
|
|
|
|
HashTable registered; /* registered */
|
|
|
|
HashTable seek; /* seek oplines */
|
2015-04-21 10:31:43 +00:00
|
|
|
zend_execute_data *seek_ex; /* call frame of oplines to seek to */
|
2015-04-21 21:09:09 +00:00
|
|
|
zend_object *handled_exception; /* last handled exception (prevent multiple handling of same exception) */
|
2013-11-26 10:02:58 +00:00
|
|
|
phpdbg_frame_t frame; /* frame */
|
2014-10-24 17:29:50 +00:00
|
|
|
uint32_t last_line; /* last executed line */
|
2013-11-25 21:39:17 +00:00
|
|
|
|
2014-06-08 20:34:30 +00:00
|
|
|
phpdbg_lexer_data lexer; /* lexer data */
|
|
|
|
phpdbg_param_t *parser_stack; /* param stack during lexer / parser phase */
|
|
|
|
|
2014-03-16 18:39:02 +00:00
|
|
|
#ifndef _WIN32
|
2013-12-11 20:27:03 +00:00
|
|
|
struct sigaction old_sigsegv_signal; /* segv signal handler */
|
2014-03-16 18:39:02 +00:00
|
|
|
#endif
|
2013-12-15 14:05:50 +00:00
|
|
|
phpdbg_btree watchpoint_tree; /* tree with watchpoints */
|
2014-03-22 13:39:39 +00:00
|
|
|
phpdbg_btree watch_HashTables; /* tree with original dtors of watchpoints */
|
2016-07-11 21:28:14 +00:00
|
|
|
HashTable watch_elements; /* user defined watch elements */
|
2014-10-24 17:29:50 +00:00
|
|
|
HashTable watch_collisions; /* collision table to check if multiple watches share the same recursive watchpoint */
|
2016-07-11 21:28:14 +00:00
|
|
|
HashTable watch_recreation; /* watch elements pending recreation of their respective watchpoints */
|
|
|
|
HashTable watch_free; /* pointers to watch for being freed */
|
|
|
|
HashTable *watchlist_mem; /* triggered watchpoints */
|
|
|
|
HashTable *watchlist_mem_backup; /* triggered watchpoints backup table while iterating over it */
|
2013-12-14 10:39:09 +00:00
|
|
|
zend_bool watchpoint_hit; /* a watchpoint was hit */
|
2014-01-10 18:54:07 +00:00
|
|
|
void (*original_free_function)(void *); /* the original AG(mm_heap)->_free function */
|
2016-07-11 21:28:14 +00:00
|
|
|
phpdbg_watch_element *watch_tmp; /* temporary pointer for a watch element */
|
2013-12-11 20:27:03 +00:00
|
|
|
|
2013-11-26 10:02:58 +00:00
|
|
|
char *exec; /* file to execute */
|
|
|
|
size_t exec_len; /* size of exec */
|
|
|
|
zend_op_array *ops; /* op_array */
|
2014-10-24 17:29:50 +00:00
|
|
|
zval retval; /* return value */
|
2013-11-26 10:02:58 +00:00
|
|
|
int bp_count; /* breakpoint count */
|
|
|
|
int vmret; /* return from last opcode handler execution */
|
2014-10-24 17:29:50 +00:00
|
|
|
zend_bool in_execution; /* in execution? */
|
2015-07-24 15:17:09 +00:00
|
|
|
zend_bool unclean_eval; /* do not check for memory leaks when we needed to bail out during eval */
|
2013-11-24 19:34:18 +00:00
|
|
|
|
2014-12-13 22:06:14 +00:00
|
|
|
zend_op_array *(*compile_file)(zend_file_handle *file_handle, int type);
|
2015-07-24 22:31:05 +00:00
|
|
|
zend_op_array *(*init_compile_file)(zend_file_handle *file_handle, int type);
|
2015-08-24 11:28:35 +00:00
|
|
|
zend_op_array *(*compile_string)(zval *source_string, char *filename);
|
2014-10-02 23:29:41 +00:00
|
|
|
HashTable file_sources;
|
2013-11-24 19:34:18 +00:00
|
|
|
|
2013-11-26 10:02:58 +00:00
|
|
|
FILE *oplog; /* opline log */
|
2015-06-22 10:56:29 +00:00
|
|
|
zend_arena *oplog_arena; /* arena for storing oplog */
|
|
|
|
phpdbg_oplog_list *oplog_list; /* list of oplog starts */
|
|
|
|
phpdbg_oplog_entry *oplog_cur; /* current oplog entry */
|
|
|
|
|
2014-09-28 00:57:12 +00:00
|
|
|
struct {
|
|
|
|
FILE *ptr;
|
|
|
|
int fd;
|
|
|
|
} io[PHPDBG_IO_FDS]; /* io */
|
2014-10-26 19:43:49 +00:00
|
|
|
int eol; /* type of line ending to use */
|
2014-12-13 22:06:14 +00:00
|
|
|
size_t (*php_stdiop_write)(php_stream *, const char *, size_t);
|
2014-09-21 02:17:19 +00:00
|
|
|
int in_script_xml; /* in <stream> output mode */
|
|
|
|
struct {
|
|
|
|
zend_bool active;
|
|
|
|
int type;
|
2014-10-07 11:08:30 +00:00
|
|
|
int fd;
|
2014-09-21 02:17:19 +00:00
|
|
|
char *tag;
|
|
|
|
char *msg;
|
|
|
|
int msglen;
|
|
|
|
char *xml;
|
|
|
|
int xmllen;
|
|
|
|
} err_buf; /* error buffer */
|
2014-10-06 09:26:08 +00:00
|
|
|
zend_ulong req_id; /* "request id" to keep track of commands */
|
2013-11-24 19:34:18 +00:00
|
|
|
|
2013-11-26 10:02:58 +00:00
|
|
|
char *prompt[2]; /* prompt */
|
|
|
|
const phpdbg_color_t *colors[PHPDBG_COLORS]; /* colors */
|
2014-04-21 20:43:19 +00:00
|
|
|
char *buffer; /* buffer */
|
2014-09-24 22:55:17 +00:00
|
|
|
zend_bool last_was_newline; /* check if we don't need to output a newline upon next phpdbg_error or phpdbg_notice */
|
2013-11-25 21:39:17 +00:00
|
|
|
|
2014-09-28 00:57:12 +00:00
|
|
|
char input_buffer[PHPDBG_MAX_CMD]; /* stdin input buffer */
|
|
|
|
int input_buflen; /* length of stdin input buffer */
|
|
|
|
phpdbg_signal_safe_mem sigsafe_mem; /* memory to use in async safe environment (only once!) */
|
|
|
|
|
2014-10-02 23:29:41 +00:00
|
|
|
JMP_BUF *sigsegv_bailout; /* bailout address for accesibility probing */
|
2013-11-25 21:39:17 +00:00
|
|
|
|
2014-10-26 19:43:49 +00:00
|
|
|
uint64_t flags; /* phpdbg flags */
|
2014-09-09 00:15:33 +00:00
|
|
|
|
|
|
|
char *socket_path; /* phpdbg.path ini setting */
|
2014-09-10 13:53:40 +00:00
|
|
|
char *sapi_name_ptr; /* store sapi name to free it if necessary to not leak memory */
|
2014-10-04 21:21:34 +00:00
|
|
|
int socket_fd; /* file descriptor to socket (wait command) (-1 if unused) */
|
|
|
|
int socket_server_fd; /* file descriptor to master socket (wait command) (-1 if unused) */
|
2014-10-20 20:12:58 +00:00
|
|
|
#ifdef PHP_WIN32
|
2014-10-26 19:43:49 +00:00
|
|
|
HANDLE sigio_watcher_thread; /* sigio watcher thread handle */
|
2014-10-20 20:12:58 +00:00
|
|
|
struct win32_sigio_watcher_data swd;
|
|
|
|
#endif
|
2015-10-18 14:08:04 +00:00
|
|
|
long lines; /* max number of lines to display */
|
2013-11-19 12:39:48 +00:00
|
|
|
ZEND_END_MODULE_GLOBALS(phpdbg) /* }}} */
|
2013-11-16 13:15:00 +00:00
|
|
|
|
2014-09-09 00:15:33 +00:00
|
|
|
#endif
|
2014-03-16 18:39:02 +00:00
|
|
|
|
2013-11-10 18:06:41 +00:00
|
|
|
#endif /* PHPDBG_H */
|