Changeset 731 for trunk/phpdop.phpr
- Timestamp:
- 04/10/2011 11:07:58 AM (2 years ago)
- Files:
-
- 1 modified
-
trunk/phpdop.phpr (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpdop.phpr
r605 r731 3 3 4 4 $srcdir = dirname(__FILE__); 5 require_once("$srcdir/Decompiler.class.php"); 5 6 if (file_exists("$srcdir/phpdc.debug.php")) { 6 7 include("$srcdir/phpdc.debug.php"); … … 11 12 switch ($op['op_type']) { 12 13 case 1: // CONST 13 return var_export($op[' u.constant'], true);14 return var_export($op['constant'], true); 14 15 15 16 case 2: // IS_TMP_VAR 16 return 't@' . $op[' u.var'];17 return 't@' . $op['var']; 17 18 18 19 case 4: 19 return 'v$' . $op[' u.var'];20 return 'v$' . $op['var']; 20 21 21 22 case 8: // UNUSED 22 if (isset($op[' u.opline_num'])) {23 return 'l#' . $op[' u.opline_num'];23 if (isset($op['opline_num'])) { 24 return 'l#' . $op['opline_num']; 24 25 } 25 26 else { … … 28 29 29 30 default: 30 return $op['op_type'] . $op[' u.var'];31 return $op['op_type'] . $op['var']; 31 32 } 32 33 } 33 34 34 function dump_opcodes($op _array, $indent = '')35 function dump_opcodes($opcodes, $indent = '') 35 36 { 37 global $decompiler; 38 36 39 $types = array('result' => 5, 'op1' => 20, 'op2' => 20); 37 foreach ($ op_arrayas $line => $op) {40 foreach ($decompiler->fixOpcode($opcodes) as $line => $op) { 38 41 echo $indent; 39 42 echo sprintf("%3d ", $op['lineno']); … … 91 94 die("Usage: $argv[0] <file>\n"); 92 95 } 96 $decompiler = new Decompiler(); 93 97 $pk = xcache_dasm_file($argv[1]); 94 98 $op_array = $funcs = $classes = null;

