com php-src: step through eval option: README.md phpdbg.c phpdbg.h phpdbg_prompt.c
| From: | Bob Weinand | Date: | Wed, 20 Nov 2013 17:01:37 +0000 |
| Subject: | com php-src: step through eval option: README.md phpdbg.c phpdbg.h phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74748@lists.php.net to get a copy of this message | ||
Commit: fdddde0d03ecf034bf0da1efe01922ac65bba867
Author: krakjoe <joe.watkins@live.co.uk> Wed, 20 Nov 2013 17:01:37 +0000
Parents: 6d0991bad60edf4a21d84bc10060d6f72b194fc5
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fdddde0d03ecf034bf0da1efe01922ac65bba867
Log:
step through eval option
Changed paths:
M README.md
M phpdbg.c
M phpdbg.h
M phpdbg_prompt.c
Diff:
diff --git a/README.md b/README.md
index c46d7b1..c058ba0 100644
--- a/README.md
+++ b/README.md
@@ -62,6 +62,7 @@ The following switches change the default behaviour of phpdbg:
- -O set oplog output file
- -q do not print banner on startup
- -r jump straight to run
+ - -E enable step through eval()
*Note: passing -rr will cause phpdbg to quit after execution, rather than returning to the console*
diff --git a/phpdbg.c b/phpdbg.c
index 9c3ca38..ec10677 100644
--- a/phpdbg.c
+++ b/phpdbg.c
@@ -393,6 +393,7 @@ const opt_struct OPTIONS[] = { /* {{{ */
{'I', 0, "ignore init"},
{'O', 1, "opline log"},
{'r', 0, "run"},
+ {'E', 0, "step-through-eval"},
{'-', 0, NULL}
}; /* }}} */
@@ -569,6 +570,10 @@ phpdbg_main:
case 's': /* set stepping on */
step = 1;
break;
+
+ case 'E': /* stepping through eval on */
+ flags |= PHPDBG_IS_STEPONEVAL;
+ break;
case 'b': /* set colours off */
flags &= ~PHPDBG_IS_COLOURED;
diff --git a/phpdbg.h b/phpdbg.h
index 889639a..2f99543 100644
--- a/phpdbg.h
+++ b/phpdbg.h
@@ -97,6 +97,7 @@
#define PHPDBG_SEEK_MASK (PHPDBG_IN_UNTIL|PHPDBG_IN_FINISH|PHPDBG_IN_LEAVE)
#define PHPDBG_IS_REGISTERED (1<<16)
+#define PHPDBG_IS_STEPONEVAL (1<<17)
#ifndef _WIN32
# define PHPDBG_DEFAULT_FLAGS (PHPDBG_IS_QUIET|PHPDBG_IS_COLOURED)
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index baa303e..dc41e24 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -489,7 +489,9 @@ PHPDBG_COMMAND(eval) /* {{{ */
zval retval;
char *code = NULL;
- PHPDBG_G(flags) &= ~ PHPDBG_IS_STEPPING;
+ if (!(PHPDBG_G(flags) & PHPDBG_IS_STEPONEVAL)) {
+ PHPDBG_G(flags) &= ~ PHPDBG_IS_STEPPING;
+ }
if (input && input->start) {
code = (char*) input->start;
@@ -516,7 +518,8 @@ PHPDBG_COMMAND(eval) /* {{{ */
PHPDBG_G(flags) &= ~PHPDBG_IN_EVAL;
/* switch stepping back on */
- if (stepping) {
+ if (stepping &&
+ !(PHPDBG_G(flags) & PHPDBG_IS_STEPONEVAL)) {
PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
}
@@ -869,6 +872,7 @@ PHPDBG_COMMAND(help) /* {{{ */
phpdbg_writeln(" -I\tN/A\t\t\tIgnore default .phpdbginit");
phpdbg_writeln(" -O\t-Omy.oplog\t\tSets oplog output file");
phpdbg_writeln(" -r\tN/A\t\t\tRun execution context");
+ phpdbg_writeln(" -E\tN/A\t\t\tEnable step through eval, careful !");
phpdbg_notice(
"Note: passing -rr will cause phpdbg to quit after execution");
phpdbg_help_footer();
@@ -1184,13 +1188,15 @@ zend_vm_enter:
#endif
#define DO_INTERACTIVE() do {\
- phpdbg_list_file(\
- zend_get_executed_filename(TSRMLS_C), \
- 3, \
- zend_get_executed_lineno(TSRMLS_C)-1, \
- zend_get_executed_lineno(TSRMLS_C) \
- TSRMLS_CC\
- );\
+ if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) {\
+ phpdbg_list_file(\
+ zend_get_executed_filename(TSRMLS_C), \
+ 3, \
+ zend_get_executed_lineno(TSRMLS_C)-1, \
+ zend_get_executed_lineno(TSRMLS_C) \
+ TSRMLS_CC\
+ );\
+ }\
\
do {\
switch (phpdbg_interactive(TSRMLS_C)) {\