1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00

updates for windows

This commit is contained in:
krakjoe
2013-11-13 21:15:45 +00:00
parent 1c1cc51295
commit 3f927019cb
4 changed files with 59 additions and 38 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
ARG_ENABLE('phpdbg', 'Build phpdbg', 'yes');
if (PHP_PHPDBG == "yes") {
SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c', 'phpdbg.exe');
SAPI('phpdbg', 'phpdbg.c phpdbg_prompt.c phpdbg_help.c phpdbg_break.c phpdbg_print.c phpdbg_bp.c phpdbg_opcode.c phpdbg_list.c phpdbg_utils.c', 'phpdbg.exe');
}
+45 -25
View File
@@ -30,7 +30,44 @@
#include "phpdbg_list.h"
#include "phpdbg_utils.h"
static const phpdbg_command_t phpdbg_prompt_commands[];
/* {{{ forward declarations */
static PHPDBG_COMMAND(exec);
static PHPDBG_COMMAND(compile);
static PHPDBG_COMMAND(step);
static PHPDBG_COMMAND(next);
static PHPDBG_COMMAND(run);
static PHPDBG_COMMAND(eval);
static PHPDBG_COMMAND(print);
static PHPDBG_COMMAND(break);
static PHPDBG_COMMAND(back);
static PHPDBG_COMMAND(list);
static PHPDBG_COMMAND(clean);
static PHPDBG_COMMAND(clear);
static PHPDBG_COMMAND(help);
static PHPDBG_COMMAND(quiet);
static PHPDBG_COMMAND(aliases);
static PHPDBG_COMMAND(quit); /* }}} */
/* {{{ command declarations */
static const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_COMMAND_EX_D(exec, "set execution context", 'e'),
PHPDBG_COMMAND_EX_D(compile, "attempt to pre-compile execution context", 'c'),
PHPDBG_COMMAND_EX_D(step, "step through execution", 's'),
PHPDBG_COMMAND_EX_D(next, "continue execution", 'n'),
PHPDBG_COMMAND_EX_D(run, "attempt execution", 'r'),
PHPDBG_COMMAND_EX_D(eval, "evaluate some code", 'E'),
PHPDBG_COMMAND_EX_D(print, "print something", 'p'),
PHPDBG_COMMAND_EX_D(break, "set breakpoint", 'b'),
PHPDBG_COMMAND_EX_D(back, "show trace", 't'),
PHPDBG_COMMAND_EX_D(list, "list specified line or function", 'l'),
PHPDBG_COMMAND_EX_D(clean, "clean the execution environment", 'X'),
PHPDBG_COMMAND_EX_D(clear, "clear breakpoints", 'C'),
PHPDBG_COMMAND_EX_D(help, "show help menu", 'h'),
PHPDBG_COMMAND_EX_D(quiet, "silence some output", 'Q'),
PHPDBG_COMMAND_EX_D(aliases, "show alias list", 'a'),
PHPDBG_COMMAND_EX_D(quit, "exit phpdbg", 'q'),
{NULL, 0, 0}
}; /* }}} */
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);
@@ -202,14 +239,17 @@ static PHPDBG_COMMAND(eval) /* {{{ */
static PHPDBG_COMMAND(back) /* {{{ */
{
zval zbacktrace;
zval **tmp;
HashPosition position;
int i = 0, limit = 0;
if (!EG(in_execution)) {
phpdbg_error("Not executing!");
return FAILURE;
}
zval zbacktrace;
zval **tmp;
HashPosition position;
int i = 0, limit = (expr != NULL) ? atoi(expr) : 0;
limit = (expr != NULL) ? atoi(expr) : 0;
zend_fetch_debug_backtrace(&zbacktrace, 0, 0, limit TSRMLS_CC);
@@ -545,26 +585,6 @@ static PHPDBG_COMMAND(list) /* {{{ */
return SUCCESS;
} /* }}} */
static const phpdbg_command_t phpdbg_prompt_commands[] = {
PHPDBG_COMMAND_EX_D(exec, "set execution context", 'e'),
PHPDBG_COMMAND_EX_D(compile, "attempt to pre-compile execution context", 'c'),
PHPDBG_COMMAND_EX_D(step, "step through execution", 's'),
PHPDBG_COMMAND_EX_D(next, "continue execution", 'n'),
PHPDBG_COMMAND_EX_D(run, "attempt execution", 'r'),
PHPDBG_COMMAND_EX_D(eval, "evaluate some code", 'E'),
PHPDBG_COMMAND_EX_D(print, "print something", 'p'),
PHPDBG_COMMAND_EX_D(break, "set breakpoint", 'b'),
PHPDBG_COMMAND_EX_D(back, "show trace", 't'),
PHPDBG_COMMAND_EX_D(list, "list specified line or function", 'l'),
PHPDBG_COMMAND_EX_D(clean, "clean the execution environment", 'X'),
PHPDBG_COMMAND_EX_D(clear, "clear breakpoints", 'C'),
PHPDBG_COMMAND_EX_D(help, "show help menu", 'h'),
PHPDBG_COMMAND_EX_D(quiet, "silence some output", 'Q'),
PHPDBG_COMMAND_EX_D(aliases, "show alias list", 'a'),
PHPDBG_COMMAND_EX_D(quit, "exit phpdbg", 'q'),
{NULL, 0, 0}
};
int phpdbg_do_cmd(const phpdbg_command_t *command, char *cmd_line, size_t cmd_len TSRMLS_DC) /* {{{ */
{
char *expr = NULL;
+4 -4
View File
@@ -91,21 +91,21 @@ int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */
/* TODO(anyone) colours */
switch (type) {
case ERROR:
case P_ERROR:
rc = printf("%s%s%s\n",
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;31m[" : "["),
buffer,
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]"));
break;
case NOTICE:
case P_NOTICE:
rc = printf("%s%s%s\n",
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[1;64m[" : "["),
buffer,
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "]\033[0m" : "]"));
break;
case WRITELN: {
case P_WRITELN: {
if (buffer) {
rc = printf("%s%s%s\n",
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[37m" : ""),
@@ -116,7 +116,7 @@ int phpdbg_print(int type TSRMLS_DC, const char *format, ...) /* {{{ */
}
} break;
case WRITE: if (buffer) {
case P_WRITE: if (buffer) {
rc = printf("%s%s%s",
((PHPDBG_G(flags) & PHPDBG_IS_COLOURED) ? "\033[37m" : ""),
buffer,
+8 -8
View File
@@ -32,18 +32,18 @@ int phpdbg_is_class_method(const char*, size_t, char**, char**);
* Error/notice/formatting helper
*/
enum {
ERROR = 1,
NOTICE,
WRITELN,
WRITE
P_ERROR = 1,
P_NOTICE,
P_WRITELN,
P_WRITE
};
int phpdbg_print(int TSRMLS_DC, const char*, ...);
#define phpdbg_error(fmt, ...) phpdbg_print(ERROR TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_notice(fmt, ...) phpdbg_print(NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_writeln(fmt, ...) phpdbg_print(WRITELN TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_write(fmt, ...) phpdbg_print(WRITE TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_error(fmt, ...) phpdbg_print(P_ERROR TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_notice(fmt, ...) phpdbg_print(P_NOTICE TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_writeln(fmt, ...) phpdbg_print(P_WRITELN TSRMLS_CC, fmt, ##__VA_ARGS__)
#define phpdbg_write(fmt, ...) phpdbg_print(P_WRITE TSRMLS_CC, fmt, ##__VA_ARGS__)
/* {{{ For writing blank lines */
#define EMPTY "" /* }}} */