mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 01:48:18 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baa3fb6bfd | ||
|
|
3cda2e5f1f | ||
|
|
dfed765d21 | ||
|
|
b60ef65803 |
@@ -1,5 +1,10 @@
|
||||
# Change Log
|
||||
|
||||
### version 0.3.1
|
||||
* Bug fixes
|
||||
* Fix issue with exception breaks crashing debugger
|
||||
* Fix issue with Android sources not displaying in VSCode 1.9
|
||||
|
||||
## version 0.3.0
|
||||
* Support for Logcat filtering using regular expressions
|
||||
* Improved expression parsing with support for arithmetic, bitwise, logical and relational operators
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "android-dev-ext",
|
||||
"displayName": "Android",
|
||||
"description": "Android debugging support for VS Code",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"publisher": "adelphes",
|
||||
"preview": true,
|
||||
"license": "MIT",
|
||||
|
||||
@@ -802,7 +802,7 @@ class AndroidDebugSession extends DebugSession {
|
||||
const srcpath = pkginfo ? path.join(pkginfo.package_path,sourcefile)
|
||||
: this._android_sources_path ? srcInfo.filepath
|
||||
: null;
|
||||
const src = new Source(sourcefile, srcpath, srcRefId);
|
||||
const src = new Source(sourcefile, srcpath, srcpath ? 0 : srcRefId);
|
||||
pkginfo && (highest_known_source=i);
|
||||
stack.push(new StackFrame(stack_frame_id, name, src, linenum, 0));
|
||||
}
|
||||
|
||||
@@ -142,6 +142,7 @@ Debugger.prototype = {
|
||||
preparedclasses: [],
|
||||
stepids: {}, // hashmap<threadid,stepid>
|
||||
suspendcount: 0, // refcount of suspend-all-threads
|
||||
threadsuspends: [], // hashmap<threadid, suspend-count>
|
||||
}
|
||||
return this;
|
||||
},
|
||||
@@ -462,12 +463,13 @@ Debugger.prototype = {
|
||||
},
|
||||
|
||||
suspendthread: function (threadid, extra) {
|
||||
return this.ensureconnected(extra)
|
||||
.then(function (extra) {
|
||||
return this.ensureconnected({threadid,extra})
|
||||
.then(function (x) {
|
||||
this.session.threadsuspends[x.threadid] = (this.session.threadsuspends[x.threadid]|0) + 1;
|
||||
return this.session.adbclient.jdwp_command({
|
||||
ths: this,
|
||||
extra: extra,
|
||||
cmd: this.JDWP.Commands.suspendthread(threadid),
|
||||
extra: x.extra,
|
||||
cmd: this.JDWP.Commands.suspendthread(x.threadid),
|
||||
});
|
||||
})
|
||||
.then((res,extra) => extra);
|
||||
@@ -508,12 +510,13 @@ Debugger.prototype = {
|
||||
},
|
||||
|
||||
resumethread: function (threadid, extra) {
|
||||
return this.ensureconnected(extra)
|
||||
.then(function (extra) {
|
||||
return this.ensureconnected({threadid,extra})
|
||||
.then(function (x) {
|
||||
this.session.threadsuspends[x.threadid] = (this.session.threadsuspends[x.threadid]|0) - 1;
|
||||
return this.session.adbclient.jdwp_command({
|
||||
ths: this,
|
||||
extra: extra,
|
||||
cmd: this.JDWP.Commands.resumethread(threadid),
|
||||
extra: x.extra,
|
||||
cmd: this.JDWP.Commands.resumethread(x.threadid),
|
||||
});
|
||||
})
|
||||
.then((res,extra) => extra);
|
||||
@@ -1022,11 +1025,35 @@ Debugger.prototype = {
|
||||
return o.def;
|
||||
})
|
||||
.then((typeinfo, method, x) => {
|
||||
x.typeinfo = typeinfo;
|
||||
x.method = method;
|
||||
// in order to invoke the method, we must undo any manual suspends of the specified thread
|
||||
// (and then resuspend after)
|
||||
var def = $.Deferred().resolveWith(this,[null,x]);
|
||||
for (var i=0; i < this.session.threadsuspends[x.threadid]|0; i++) {
|
||||
def = def.then((res,x) => this.session.adbclient.jdwp_command({
|
||||
ths: this, extra:x, cmd: this.JDWP.Commands.resumethread(x.threadid),
|
||||
}));
|
||||
}
|
||||
return def;
|
||||
})
|
||||
.then((res,x) => {
|
||||
return this.session.adbclient.jdwp_command({
|
||||
ths: this,
|
||||
extra: x,
|
||||
cmd: this.JDWP.Commands.InvokeMethod(x.objectid, x.threadid, typeinfo.info.typeid, method.methodid, x.args),
|
||||
});
|
||||
cmd: this.JDWP.Commands.InvokeMethod(x.objectid, x.threadid, x.typeinfo.info.typeid, x.method.methodid, x.args),
|
||||
})
|
||||
})
|
||||
.then((res, x) => {
|
||||
// save the result and re-suspend the thread
|
||||
x.res = res;
|
||||
var def = $.Deferred().resolveWith(this,[null,x]);
|
||||
for (var i=0; i < this.session.threadsuspends[x.threadid]|0; i++) {
|
||||
def = def.then((res,x) => this.session.adbclient.jdwp_command({
|
||||
ths: this, extra:x, cmd: this.JDWP.Commands.suspendthread(x.threadid),
|
||||
}));
|
||||
}
|
||||
return def.then((res,x) => $.Deferred().resolveWith(this, [x.res, x]));
|
||||
})
|
||||
.then((res, x) => {
|
||||
if (/^0+$/.test(res.exception))
|
||||
@@ -1636,7 +1663,7 @@ Debugger.prototype = {
|
||||
},
|
||||
fn: function (e) {
|
||||
// each exception hit contributes a global suspend
|
||||
x.dbgr.session.suspendcount++;
|
||||
e.data.dbgr.session.suspendcount++;
|
||||
// if this exception break occurred during a step request, we must manually clear the event
|
||||
// or the (device-side) debugger will crash on next step
|
||||
this._clearLastStepRequest(e.event.threadid, e).then(e => {
|
||||
|
||||
Reference in New Issue
Block a user