remove clviewer and broke things

This commit is contained in:
George Hotz 2014-07-01 11:47:33 -07:00
parent 1503863c77
commit 635854f065
3 changed files with 5 additions and 114 deletions

View File

@ -1,69 +0,0 @@
var X86REGS = ['EAX', 'ECX', 'EDX', 'EBX', 'ESP', 'EBP', 'ESI', 'EDI', 'EIP'];
Template.changelist.currentchanges = function() {
var clnum = Session.get('clnum');
return Change.find({clnum: clnum}, {sort: {address: 1}, limit:20});
};
Template.changelist.iaddr = function() { return hex(Session.get('iaddr')); };
Template.changelist.daddr = function() { return hex(Session.get('daddr')); };
Template.changelist.clnum = function() { return Session.get('clnum'); };
Template.changelist.icllist = function() {
var iaddr = Session.get('iaddr');
return Change.find({address: iaddr, type: "I"}, {sort: {clnum: 1},limit:10})
};
Template.changelist.dcllist = function() {
var daddr = Session.get('daddr');
if (daddr >= 0x1000) {
return Change.find({address:daddr}, {sort: {clnum: 1},limit:10});
} else {
return false;
}
};
Template.change.is_mem = function() {
return this.type == "L" || this.type == "S";
};
Template.change.events({
'click .daddress': function() {
p("new daddr is "+hex(this.address));
var addr = this.address;
// update_dview should be called here
Session.set('daddr', addr);
Session.set('dview', (addr-0x20)-(addr-0x20)%0x10);
},
});
Template.change.handleaddress = function () {
if (this.type == "I") {
Session.set("iaddr", this.address);
}
if (this.type == "R" || this.type == "W") {
if (this.address < (X86REGS.length*4)) {
return X86REGS[this.address/4];
} else {
return hex(this.address);
}
} else {
return hex(this.address);
}
};
Template.change.handledata = function () {
return hex(this.data);
};
Template.cl.events({
'click .change': function() {
Session.set('clnum', this.clnum);
}
});
// these three draw the changelist viewer
Deps.autorun(function(){ Meteor.subscribe('dat_clnum', Session.get("clnum")); });
Deps.autorun(function(){ Meteor.subscribe('dat_iaddr', Session.get("iaddr")); });
Deps.autorun(function(){ Meteor.subscribe('dat_daddr', Session.get("daddr")); });

View File

@ -152,5 +152,9 @@ Deps.autorun(function() {
});
Meteor.subscribe('pmaps');
Deps.autorun(function(){ Meteor.subscribe('dat_clnum', Session.get("clnum")); });
Deps.autorun(function(){ Meteor.subscribe('dat_clnum', Session.get("clnum"), {onReady: function() {
var row = Change.findOne({"clnum": Session.get("clnum"), "type": "I"});
if (row === undefined) return;
Session.set("iaddr", row.address);
}}); });

View File

@ -20,9 +20,6 @@
<div id="idump">
{{> idump}}
</div>
<div id="clviewer">
{{> changelist}}
</div>
<div id="regviewer">
</div>
<div id="datachanges">
@ -72,44 +69,3 @@
<div id="hexdump"></div>
</template>
<!-- related to the changelist viewer -->
<template name="changelist">
<table id="bigcltable">
<tr><td>
<table class="cltable">
{{#each currentchanges}}
{{> change}}
{{/each}}
</table>
</td><td>
<table class="cltable">
{{#each icllist}}
{{> cl}}
{{/each}}
</table>
</td><td>
<table class="cltable">
{{#each dcllist}}
{{> cl}}
{{/each}}
</table>
</td></tr></table>
</template>
<template name="cl">
<tr><td class="change">{{clnum}}</td><td>{{type}}</td></tr>
</template>
<template name="change">
<tr>
{{#if is_mem}}
<td class="daddress">{{handleaddress}}</td>
{{else}}
<td>{{handleaddress}}</td>
{{/if}}
<td>{{type}}</td>
<td>{{handledata}}</td>
</tr>
</template>