Changeset 731 for trunk/phpdop.phpr


Ignore:
Timestamp:
2011-04-10T11:07:58+02:00 (4 years ago)
Author:
moo
Message:

PHP_6: disassembler/decompiler: fix function static variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpdop.phpr

    r605 r731  
    33 
    44$srcdir = dirname(__FILE__); 
     5require_once("$srcdir/Decompiler.class.php"); 
    56if (file_exists("$srcdir/phpdc.debug.php")) { 
    67    include("$srcdir/phpdc.debug.php"); 
     
    1112    switch ($op['op_type']) { 
    1213    case 1: // CONST 
    13         return var_export($op['u.constant'], true); 
     14        return var_export($op['constant'], true); 
    1415 
    1516    case 2: // IS_TMP_VAR 
    16         return 't@' . $op['u.var']; 
     17        return 't@' . $op['var']; 
    1718 
    1819    case 4: 
    19         return 'v$' . $op['u.var']; 
     20        return 'v$' . $op['var']; 
    2021 
    2122    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']; 
    2425        } 
    2526        else { 
     
    2829 
    2930    default: 
    30         return $op['op_type'] . $op['u.var']; 
     31        return $op['op_type'] . $op['var']; 
    3132    } 
    3233} 
    3334 
    34 function dump_opcodes($op_array, $indent = '') 
     35function dump_opcodes($opcodes, $indent = '') 
    3536{ 
     37    global $decompiler; 
     38 
    3639    $types = array('result' => 5, 'op1' => 20, 'op2' => 20); 
    37     foreach ($op_array as $line => $op) { 
     40    foreach ($decompiler->fixOpcode($opcodes) as $line => $op) { 
    3841        echo $indent; 
    3942        echo sprintf("%3d ", $op['lineno']); 
     
    9194    die("Usage: $argv[0] <file>\n"); 
    9295} 
     96$decompiler = new Decompiler(); 
    9397$pk = xcache_dasm_file($argv[1]); 
    9498$op_array = $funcs = $classes = null; 
Note: See TracChangeset for help on using the changeset viewer.