only view the changes in the view

This commit is contained in:
George Hotz 2014-08-10 10:45:39 +00:00
parent 98588675c1
commit 2303a7fb9f
3 changed files with 9 additions and 10 deletions

View File

@ -354,8 +354,6 @@ def slice(trace, inclnum):
def get_loads(clnum):
return set(map(lambda x: x['address'], filter(is_load, trace.db.fetch_changes_by_clnum(clnum, 100))))
clnum = inclnum
st = get_loads(clnum)
cls = [clnum]
@ -383,7 +381,6 @@ def slice(trace, inclnum):
cls = set(cls)
cls.discard(inclnum)
return list(cls)
if __name__ == "__main__":
# can run standalone for testing

View File

@ -21,7 +21,7 @@ import time
import qira_analysis
import qira_log
LIMIT = 400
LIMIT = 200
from flask import Flask, Response
from flask.ext.socketio import SocketIO, emit
@ -190,8 +190,8 @@ def getclnum(forknum, clnum, types, limit):
emit('clnum', ret)
@socketio.on('getchanges', namespace='/qira')
def getchanges(forknum, address, typ):
if address == None or typ == None:
def getchanges(forknum, address, typ, cview):
if address == None or typ == None or cview == None:
return
if forknum != -1 and forknum not in program.traces:
return
@ -204,7 +204,7 @@ def getchanges(forknum, address, typ):
forknums = [forknum]
ret = {}
for forknum in forknums:
ret[forknum] = program.traces[forknum].db.fetch_clnums_by_address_and_type(address, chr(ord(typ[0])), 0, LIMIT)
ret[forknum] = program.traces[forknum].db.fetch_clnums_by_address_and_type(address, chr(ord(typ[0])), cview[0], LIMIT)
emit('changes', {'type': typ, 'clnums': ret})
@socketio.on('getinstructions', namespace='/qira')

View File

@ -306,15 +306,17 @@ Deps.autorun(function() {
//var forknum = Session.get("forknum");
var iaddr = Session.get('iaddr');
var maxclnum = Session.get('max_clnum');
stream.emit('getchanges', -1, iaddr, 'I')
var cview = Session.get('cview');
stream.emit('getchanges', -1, iaddr, 'I', cview)
});
Deps.autorun(function() {
//var forknum = Session.get("forknum");
var daddr = Session.get('daddr');
var maxclnum = Session.get('max_clnum');
stream.emit('getchanges', -1, daddr, 'L')
stream.emit('getchanges', -1, daddr, 'S')
var cview = Session.get('cview');
stream.emit('getchanges', -1, daddr, 'L', cview)
stream.emit('getchanges', -1, daddr, 'S', cview)
});
stream.on('changes', function(msg) {