]> granicus.if.org Git - php/commitdiff
show opcode count
authorBob Weinand <bobwei9@hotmail.com>
Mon, 20 Apr 2015 11:04:56 +0000 (13:04 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Mon, 20 Apr 2015 11:04:56 +0000 (13:04 +0200)
sapi/phpdbg/phpdbg.c
sapi/phpdbg/phpdbg.h
sapi/phpdbg/phpdbg_help.c
sapi/phpdbg/phpdbg_print.c

index a93a062d2ec050bf9fc9de2969b05daedb9354bf..eb8369b86f77dbdc72711df733a7f9001f5e5793 100644 (file)
@@ -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);
index c76e460495567bf8b608149c746097f766e1d53a..c636a7c791cf99e0b9a74b8e29a309de7ced82df 100644 (file)
@@ -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)
index 022a919f5200758855cc48cd8b4a06f3a49223f5..6b105511924326ce0c48b38acbb798eabb0a2af2 100644 (file)
@@ -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 "
index ffdf325b5b564fb60df271797d1900426102b0e7..ffd22859af58dbd675cfb4d78f35838e110a2230 100644 (file)
@@ -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);