mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-25 19:10:12 +00:00
first pass at hit-count breakpoints
This commit is contained in:
30
src/jdwp.js
30
src/jdwp.js
@@ -1051,21 +1051,35 @@ function _JDWP() {
|
||||
onevent
|
||||
);
|
||||
},
|
||||
SetBreakpoint:function(ci, mi, idx, onevent) {
|
||||
SetBreakpoint:function(ci, mi, idx, hitcount, onevent) {
|
||||
// a wrapper around SetEventRequest
|
||||
var mods = [{
|
||||
modkind:7, // location
|
||||
loc:{ type:ci.info.reftype.value, cid:ci.info.typeid, mid:mi.methodid, idx:idx }
|
||||
loc:{ type:ci.info.reftype.value, cid:ci.info.typeid, mid:mi.methodid, idx:idx },
|
||||
encode(res) {
|
||||
res.push(this.modkind);
|
||||
res.push(this.loc.type);
|
||||
DataCoder.encodeRef(res, this.loc.cid);
|
||||
DataCoder.encodeRef(res, this.loc.mid);
|
||||
DataCoder.encodeLong(res, this.loc.idx);
|
||||
}
|
||||
}];
|
||||
if (hitcount > 0) {
|
||||
// remember when setting a hitcount, the event is automatically cancelled after being fired
|
||||
mods.unshift({
|
||||
modkind:1,
|
||||
count: hitcount,
|
||||
encode(res) {
|
||||
res.push(this.modkind);
|
||||
DataCoder.encodeInt(res, this.count);
|
||||
}
|
||||
})
|
||||
}
|
||||
// kind(2=breakpoint)
|
||||
// suspendpolicy(0=none,1=event-thread,2=all)
|
||||
return this.SetEventRequest("breakpoint",2,2,mods,
|
||||
function(m1, i, res) {
|
||||
res.push(m1.modkind);
|
||||
res.push(m1.loc.type);
|
||||
DataCoder.encodeRef(res, m1.loc.cid);
|
||||
DataCoder.encodeRef(res, m1.loc.mid);
|
||||
DataCoder.encodeLong(res, m1.loc.idx);
|
||||
function(m, i, res) {
|
||||
m.encode(res,i);
|
||||
},
|
||||
onevent
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user