mirror of
https://github.com/geohot/qira
synced 2025-02-11 12:04:11 +03:00
trails bugfixes
This commit is contained in:
parent
8ae77cc0f5
commit
be0329f73a
@ -91,8 +91,7 @@ function rehighlight() {
|
||||
for (var i = 0; i < trail.length; i++) {
|
||||
var cldiff = trail[i][0];
|
||||
if (cldiff <= 0) {
|
||||
var htrail = $($(".insaddr.addr_"+trail[i][1]).parents(".instruction_static")[0]);
|
||||
p(cldiff, htrail);
|
||||
var htrail = $($(".insaddr.addr_"+trail[i][1]).parents(".instruction_static"));
|
||||
var opacity = ((16+cldiff)/35.0);
|
||||
htrail.css('background-color', 'rgba(0,0,255,'+opacity+')');
|
||||
htrail.addClass("trail");
|
||||
|
@ -1,5 +1,8 @@
|
||||
stream = io.connect(STREAM_URL);
|
||||
|
||||
// TODO: parameter should be dynamic?
|
||||
var backward_context_size = 6;
|
||||
|
||||
// arch is public data
|
||||
arch = undefined;
|
||||
function on_arch(msg) { DS("arch");
|
||||
@ -27,8 +30,8 @@ function on_instructions(msg) { DS("instructions");
|
||||
addrs.push([ins.clnum-clnum, ins.address]);
|
||||
|
||||
// compute the dynamic stuff
|
||||
// TODO: hacks for trail stuff working
|
||||
if (i >= 10) {
|
||||
// TODO: hacks for trail stuff working, shitty off by ones here
|
||||
if (i >= 10 || ins.clnum >= (clnum - backward_context_size)) {
|
||||
idump +=
|
||||
'<div class="instruction" style="margin-left: '+(ins.depth*10)+'px">'+
|
||||
'<div class="change '+(ins.slice ? "halfhighlight": "")+' clnum clnum_'+ins.clnum+'">'+ins.clnum+'</div> '+
|
||||
@ -57,7 +60,7 @@ Deps.autorun(function() { DA("emit getinstructions");
|
||||
|
||||
// TODO: make this clean
|
||||
var size = get_size("#idump");
|
||||
var end = Math.min(maxclnum[1]+1, clnum+size-6);
|
||||
var end = Math.min(maxclnum[1]+1, clnum+size-backward_context_size);
|
||||
var start = Math.max(maxclnum[0], end-size);
|
||||
if (maxclnum[0] > (end-size)) end += maxclnum[0] - (end-size) + 1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user