Changeset 198 for eaccelerator/trunk/dasm.php
- Timestamp:
- 04/11/06 13:37:25 (3 years ago)
- Files:
-
- eaccelerator/trunk/dasm.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/dasm.php
r196 r198 70 70 <h1>eAccelerator disassembler</h1> 71 71 <?php 72 if (!isset($_GET['file']) &&!is_file($_GET['file'])) {72 if (!isset($_GET['file']) || !is_file($_GET['file'])) { 73 73 die('File argument not given!'); 74 74 } … … 124 124 <tr> 125 125 <th>N</th> 126 <th>Line</th> 126 127 <th>Opcode</th> 127 128 <th>Extented value</th> … … 134 135 $line = 0; 135 136 global $source; 136 $last_line = 0;137 137 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']; 148 143 } 149 144 $code = ''; … … 154 149 if ($code != '') { 155 150 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"; 158 153 echo "</tr>\n"; 159 154 } … … 161 156 <tr> 162 157 <td class="e"><?php echo $i; ?></td> 158 <td><nobr><?php echo $op_array[$i]['lineno']; ?></nobr></td> 163 159 <td><nobr><?php echo $op_array[$i]['opcode']; ?></nobr></td> 164 160 <td><nobr><?php echo $op_array[$i]['extended_value']; ?></nobr></td> … … 178 174 if ($code != '') { 179 175 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"; 182 178 echo "</tr>\n"; 183 179 }