Changeset 198

Show
Ignore:
Timestamp:
04/11/06 13:37:25 (2 years ago)
Author:
bart
Message:

* Patch for dasm.php form Stadler, see #23

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r197 r198  
    66        * Added release notes for beta2 
    77        * Bumped up version to 0.9.5-beta2 
     8        * Patch for dasm.php form Stadler, see #23 
    89        * Released beta2 
    910 
  • eaccelerator/trunk/dasm.php

    r196 r198  
    7070<h1>eAccelerator disassembler</h1> 
    7171<?php 
    72     if (!isset($_GET['file']) && !is_file($_GET['file'])) { 
     72    if (!isset($_GET['file']) || !is_file($_GET['file'])) { 
    7373        die('File argument not given!'); 
    7474    } 
     
    124124            <tr> 
    125125                <th>N</th> 
     126                <th>Line</th> 
    126127                <th>Opcode</th> 
    127128                <th>Extented value</th> 
     
    134135                $line = 0; 
    135136                global $source; 
    136                 $last_line = 0; 
    137137                for ($i = 0; $i < $count; ++$i) { 
    138                         $curr_line =  $op_array[$i]['lineno']; 
    139                         /* find the next line that differs, but only when the start line differs from the previous */ 
    140                         $print = $line; 
    141                         if ($last_line < $curr_line) { 
    142                                 for ($j = $i + 1; $j < $count; ++$j) { 
    143                                         if ($op_array[$j]['lineno'] > $curr_line) { 
    144                                                 $print = $op_array[$j]['lineno'] - 1; 
    145                                                 break; 
    146                                         } 
    147                                 } 
     138                        /* if the lineno is greater, than the last line displayed, then show the 
     139                           code until that line above the opcode */ 
     140                        if ($line < $op_array[$i]['lineno']) 
     141                        { 
     142                                $print = $op_array[$i]['lineno']; 
    148143                        } 
    149144                        $code = ''; 
     
    154149                        if ($code != '') { 
    155150                                echo "<tr>\n"; 
    156 //                              echo '<td  class="source" colspan="6"><pre>' . highlight_string($code, true) . "</pre></td>\n"; 
    157                                 echo '<td  class="source" colspan="6"><pre>' . $code . "</pre></td>\n"; 
     151//                              echo '<td  class="source" colspan="7"><pre>' . highlight_string($code, true) . "</pre></td>\n"; 
     152                                echo '<td  class="source" colspan="7"><pre>' . $code . "</pre></td>\n"; 
    158153                                echo "</tr>\n"; 
    159154                        } 
     
    161156            <tr> 
    162157                <td class="e"><?php echo $i; ?></td> 
     158                <td><nobr><?php echo $op_array[$i]['lineno']; ?></nobr></td> 
    163159                <td><nobr><?php echo $op_array[$i]['opcode']; ?></nobr></td> 
    164160                <td><nobr><?php echo $op_array[$i]['extended_value']; ?></nobr></td> 
     
    178174                        if ($code != '') { 
    179175                                echo "<tr>\n"; 
    180                                //              echo '<td  class="source" colspan="6"><pre>' . highlight_string($code, true) . "</pre></td>\n"; 
    181                                 echo '<td  class="source" colspan="6"><pre>' . $code . "</pre></td>\n"; 
     176//                             echo '<td  class="source" colspan="7"><pre>' . highlight_string($code, true) . "</pre></td>\n"; 
     177                                echo '<td  class="source" colspan="7"><pre>' . $code . "</pre></td>\n"; 
    182178                                echo "</tr>\n"; 
    183179                        }