com php-src: show opcode count: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_print.c
| From: | Bob Weinand | Date: | Mon, 20 Apr 2015 11:04:56 +0000 |
| Subject: | com php-src: show opcode count: sapi/phpdbg/phpdbg.c sapi/phpdbg/phpdbg.h sapi/phpdbg/phpdbg_help.c sapi/phpdbg/phpdbg_print.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86399@lists.php.net to get a copy of this message | ||
Commit: 5f35e571fa3b73714d917564ed1a11184853cc6a
Author: Bob Weinand <bobwei9@hotmail.com> Mon, 20 Apr 2015 13:04:56 +0200
Parents: 1a249bd6745131cc68f72b2cfc9b8ca789b221ee
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5f35e571fa3b73714d917564ed1a11184853cc6a
Log:
show opcode count
Changed paths:
M sapi/phpdbg/phpdbg.c
M sapi/phpdbg/phpdbg.h
M sapi/phpdbg/phpdbg_help.c
M sapi/phpdbg/phpdbg_print.c
Diff:
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index a93a062..eb8369b 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -763,7 +763,6 @@ const opt_struct OPTIONS[] = { /* {{{ */
#endif
{'x', 0, "xml output"},
{'p', 2, "show opcodes"},
- {'o', 0, "display opline addresses"},
{'h', 0, "help"},
{'V', 0, "version"},
{'-', 0, NULL}
@@ -1214,10 +1213,6 @@ phpdbg_main:
settings = (void *) 0x1;
} break;
- case 'o':
- flags |= PHPDBG_PRINT_OPLINE_ADDR;
- break;
-
case 'h': {
sapi_startup(phpdbg);
phpdbg->startup(phpdbg);
diff --git a/sapi/phpdbg/phpdbg.h b/sapi/phpdbg/phpdbg.h
index c76e460..c636a7c 100644
--- a/sapi/phpdbg/phpdbg.h
+++ b/sapi/phpdbg/phpdbg.h
@@ -187,11 +187,10 @@ int phpdbg_do_parse(phpdbg_param_t *stack, char *input);
#define PHPDBG_WRITE_XML (1ULL<<31)
#define PHPDBG_SHOW_REFCOUNTS (1ULL<<32)
-#define PHPDBG_PRINT_OPLINE_ADDR (1ULL<<33)
-#define PHPDBG_IN_SIGNAL_HANDLER (1ULL<<34)
+#define PHPDBG_IN_SIGNAL_HANDLER (1ULL<<33)
-#define PHPDBG_DISCARD_OUTPUT (1ULL<<35)
+#define PHPDBG_DISCARD_OUTPUT (1ULL<<34)
#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)
diff --git a/sapi/phpdbg/phpdbg_help.c b/sapi/phpdbg/phpdbg_help.c
index 022a919..6b10551 100644
--- a/sapi/phpdbg/phpdbg_help.c
+++ b/sapi/phpdbg/phpdbg_help.c
@@ -390,7 +390,6 @@ phpdbg_help_text_t phpdbg_help_text[] = {
" **-a** **-a**192.168.0.3 Setup remote console bind address" CR
" **-x** Enable xml output (instead of normal text output)" CR
" **-p** **-p**, **-p=func**, **-p* ** Output opcodes and quit" CR
-" **-o** Display opline addresses in opline dumps" CR
" **-h** Print the help overview" CR
" **-V** Print version number" CR
" **--** **--** arg1 arg2 Use to delimit phpdbg arguments and php $argv; append
any $argv "
diff --git a/sapi/phpdbg/phpdbg_print.c b/sapi/phpdbg/phpdbg_print.c
index ffdf325..ffd2285 100644
--- a/sapi/phpdbg/phpdbg_print..c
+++ b/sapi/phpdbg/phpdbg_print.c
@@ -63,36 +63,33 @@ static inline void phpdbg_print_function_helper(zend_function *method) /* {{{ */
end = op_array->last-1;
if (method->common.scope) {
- phpdbg_writeln("printoplineinfo", "type=\"User\"
startline=\"%d\" endline=\"%d\" method=\"%s::%s\"
file=\"%s\"", "L%d-%d %s::%s() %s",
+ phpdbg_writeln("printoplineinfo", "type=\"User\"
startline=\"%d\" endline=\"%d\" method=\"%s::%s\"
file=\"%s\" opline=\"%p\"", "L%d-%d %s::%s() %s - %p + %d ops",
op_array->line_start,
op_array->line_end,
method->common.scope->name->val,
method->common.function_name->val,
- op_array->filename ? op_array->filename->val : "unknown");
+ op_array->filename ? op_array->filename->val : "unknown",
+ opline,
+ op_array->last);
} else {
- phpdbg_writeln("printoplineinfo", "type=\"User\"
startline=\"%d\" endline=\"%d\" function=\"%s\"
file=\"%s\"", "L%d-%d %s() %s",
+ phpdbg_writeln("printoplineinfo", "type=\"User\"
startline=\"%d\" endline=\"%d\" function=\"%s\" file=\"%s\"
opline=\"%p\"", "L%d-%d %s() %s - %p + %d ops",
method->common.function_name ? op_array->line_start : 0,
method->common.function_name ? op_array->line_end : 0,
method->common.function_name ? method->common.function_name->val :
"{main}",
- op_array->filename ? op_array->filename->val : "unknown");
+ op_array->filename ? op_array->filename->val : "unknown",
+ opline,
+ op_array->last);
}
zend_hash_init(&vars, op_array->last, NULL, NULL, 0);
do {
char *decode = phpdbg_decode_opline(op_array, opline, &vars);
if (decode != NULL) {
- if (PHPDBG_G(flags) & PHPDBG_PRINT_OPLINE_ADDR) {
- phpdbg_writeln("print", "line=\"%u\" opline=\"%p\"
opcode=\"%s\" op=\"%s\"", " L%-5u %p %-36s %s",
- opline->lineno,
- opline,
- phpdbg_decode_opcode(opline->opcode),
- decode);
- } else {
- phpdbg_writeln("print", "line=\"%u\" opcode=\"%s\"
op=\"%s\"", " L%-5u %-36s %s",
- opline->lineno,
- phpdbg_decode_opcode(opline->opcode),
- decode);
- }
+ phpdbg_writeln("print", "line=\"%u\" opnum=\"%u\"
opcode=\"%s\" op=\"%s\"", " L%-5u #%-5u %-36s %s",
+ opline->lineno,
+ opcode,
+ phpdbg_decode_opcode(opline->opcode),
+ decode);
free(decode);
} else {
phpdbg_error("print", "type=\"decodefailure\"
opline=\"%16p\"", "Failed to decode opline %16p", opline);