Ticket #23: dasm.php.patch
| File dasm.php.patch, 2.7 kB (added by Stadler, 2 years ago) |
|---|
-
dasm.php
old new 69 69 <body class="center"> 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 } 75 75 $file = $_GET['file']; … … 123 123 <table> 124 124 <tr> 125 125 <th>N</th> 126 <th>Line</th> 126 127 <th>Opcode</th> 127 128 <th>Extented value</th> 128 129 <th>Op1</th> … … 133 134 $count = count($op_array); 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 = ''; 150 145 while($line < $print) { … … 153 148 } 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 } 160 155 ?> 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> 165 161 <td><nobr><?php echo convert_string($op_array[$i]['op1'], 50); ?></nobr></td> … … 177 173 } 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 } 184 180