com php-src: - Simplify code: phpdbg_prompt.c
| From: | Bob Weinand | Date: | Sun, 10 Nov 2013 18:15:00 +0000 |
| Subject: | com php-src: - Simplify code: phpdbg_prompt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75190@lists.php.net to get a copy of this message | ||
Commit: 226052fb8ace69330a154da160af7f8bbf590459
Author: Felipe Pena <felipensp@gmail.com> Sun, 10 Nov 2013 16:15:00 -0200
Parents: a7309b6d25c986f5e75f7c1ccdc12b48bf98807f
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=226052fb8ace69330a154da160af7f8bbf590459
Log:
- Simplify code
Changed paths:
M phpdbg_prompt.c
Diff:
diff --git a/phpdbg_prompt.c b/phpdbg_prompt.c
index cec6abb..cb24a3e 100644
--- a/phpdbg_prompt.c
+++ b/phpdbg_prompt.c
@@ -177,28 +177,34 @@ static PHPDBG_COMMAND(back) { /* {{{ */
}
} /* }}} */
-static PHPDBG_COMMAND(print) { /* {{{ */
- if (!expr_len) {
- printf("Showing Execution Context Information:\n");
- printf("Exec\t\t%s\n", PHPDBG_G(exec) ? PHPDBG_G(exec) : "none");
- printf("Compiled\t%s\n", PHPDBG_G(ops) ? "yes" : "no");
- printf("Stepping\t%s\n", PHPDBG_G(stepping) ? "on" : "off");
- if (PHPDBG_G(ops)) {
- printf("Opcodes\t\t%d\n", PHPDBG_G(ops)->last);
- if (PHPDBG_G(ops)->last_var) {
- printf("Variables\t%d\n", PHPDBG_G(ops)->last_var-1);
- } else printf("Variables\tNone\n");
- }
- printf("Executing\t%s\n", EG(in_execution) ? "yes" : "no");
- if (EG(in_execution)) {
- printf("VM Return\t%d\n", PHPDBG_G(vmret));
- }
- } else {
- printf(
- "%s\n", expr);
- }
+static PHPDBG_COMMAND(print) /* {{{ */
+{
+ if (expr_len) {
+ printf("%s\n", expr);
+ return SUCCESS;
+ }
- return SUCCESS;
+ printf("Showing Execution Context Information:\n");
+ printf("Exec\t\t%s\n", PHPDBG_G(exec) ? PHPDBG_G(exec) : "none");
+ printf("Compiled\t%s\n", PHPDBG_G(ops) ? "yes" : "no");
+ printf("Stepping\t%s\n", PHPDBG_G(stepping) ? "on" : "off");
+
+ if (PHPDBG_G(ops)) {
+ printf("Opcodes\t\t%d\n", PHPDBG_G(ops)->last);
+
+ if (PHPDBG_G(ops)->last_var) {
+ printf("Variables\t%d\n", PHPDBG_G(ops)->last_var-1);
+ } else {
+ printf("Variables\tNone\n");
+ }
+ }
+ printf("Executing\t%s\n", EG(in_execution) ? "yes" : "no");
+
+ if (EG(in_execution)) {
+ printf("VM Return\t%d\n", PHPDBG_G(vmret));
+ }
+
+ return SUCCESS;
} /* }}} */
static PHPDBG_COMMAND(break) /* {{{ */
@@ -317,7 +323,7 @@ int phpdbg_interactive(int argc, char **argv TSRMLS_DC) /* {{{ */
case PHPDBG_NEXT: if (PHPDBG_G(stepping)) {
return PHPDBG_NEXT;
}
-
+
}
}
@@ -331,7 +337,7 @@ int phpdbg_interactive(int argc, char **argv TSRMLS_DC) /* {{{ */
static void phpdbg_print_opline(zend_execute_data *execute_data TSRMLS_DC) { /* {{{ */
zend_op *opline = execute_data->opline;
-
+
printf(
"[OPLINE: %p:%d]\n", opline, opline->opcode);
} /* }}} */