mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-22 09:29:38 +00:00
breakpoints do not get enabled on startup (#40)
* add more trace around breakpoint config during startup * use 'changed' instead of 'updated' when sending BreakpointEvents
This commit is contained in:
@@ -536,6 +536,7 @@ class AndroidDebugSession extends DebugSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configurationDoneRequest(response/*, args*/) {
|
configurationDoneRequest(response/*, args*/) {
|
||||||
|
D('configurationDoneRequest');
|
||||||
this.waitForConfigurationDone.resolve();
|
this.waitForConfigurationDone.resolve();
|
||||||
this.sendResponse(response);
|
this.sendResponse(response);
|
||||||
}
|
}
|
||||||
@@ -566,13 +567,14 @@ class AndroidDebugSession extends DebugSession {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onBreakpointStateChange(e) {
|
onBreakpointStateChange(e) {
|
||||||
|
D('onBreakpointStateChange');
|
||||||
e.breakpoints.forEach(javabp => {
|
e.breakpoints.forEach(javabp => {
|
||||||
// if there's no associated vsbp we're deleting it, so just ignore the update
|
// if there's no associated vsbp we're deleting it, so just ignore the update
|
||||||
if (!javabp.vsbp) return;
|
if (!javabp.vsbp) return;
|
||||||
var verified = !!javabp.state.match(/set|enabled/);
|
var verified = !!javabp.state.match(/set|enabled/);
|
||||||
javabp.vsbp.verified = verified;
|
javabp.vsbp.verified = verified;
|
||||||
javabp.vsbp.message = null;
|
javabp.vsbp.message = null;
|
||||||
this.sendEvent(new BreakpointEvent('updated', javabp.vsbp));
|
this.sendEvent(new BreakpointEvent('changed', javabp.vsbp));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -597,6 +599,14 @@ class AndroidDebugSession extends DebugSession {
|
|||||||
return bp;
|
return bp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sendBPResponse = (response, breakpoints) => {
|
||||||
|
D('setBreakPointsRequest response ' + JSON.stringify(breakpoints.map(bp => bp.verified)));
|
||||||
|
response.body = {
|
||||||
|
breakpoints,
|
||||||
|
};
|
||||||
|
this.sendResponse(response);
|
||||||
|
}
|
||||||
|
|
||||||
// the file must lie inside one of the source packages we found (and it must be have a .java extension)
|
// the file must lie inside one of the source packages we found (and it must be have a .java extension)
|
||||||
var srcfolder = path.dirname(srcfpn);
|
var srcfolder = path.dirname(srcfpn);
|
||||||
var pkginfo;
|
var pkginfo;
|
||||||
@@ -612,10 +622,7 @@ class AndroidDebugSession extends DebugSession {
|
|||||||
if (!pkginfo || !/\.(java|kt)$/i.test(srcfpn)) {
|
if (!pkginfo || !/\.(java|kt)$/i.test(srcfpn)) {
|
||||||
// source file is not a java file or is outside of the known source packages
|
// source file is not a java file or is outside of the known source packages
|
||||||
// just send back a list of unverified breakpoints
|
// just send back a list of unverified breakpoints
|
||||||
response.body = {
|
sendBPResponse(response, args.breakpoints.map(bp => unverified_breakpoint(bp, 'The breakpoint location is not valid')));
|
||||||
breakpoints: args.breakpoints.map(bp => unverified_breakpoint(bp, 'The breakpoint location is not valid'))
|
|
||||||
};
|
|
||||||
this.sendResponse(response);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,10 +689,7 @@ class AndroidDebugSession extends DebugSession {
|
|||||||
this._setup_breakpoints(this._queue[0]).then(javabp_arr => {
|
this._setup_breakpoints(this._queue[0]).then(javabp_arr => {
|
||||||
// send back the VS Breakpoint instances
|
// send back the VS Breakpoint instances
|
||||||
var response = this._queue[0].response;
|
var response = this._queue[0].response;
|
||||||
response.body = {
|
sendBPResponse(response, javabp_arr.map(javabp => javabp.vsbp));
|
||||||
breakpoints: javabp_arr.map(javabp => javabp.vsbp)
|
|
||||||
};
|
|
||||||
this._dbgr.sendResponse(response);
|
|
||||||
// .. and do the next one
|
// .. and do the next one
|
||||||
this._queue.shift();
|
this._queue.shift();
|
||||||
this._next();
|
this._next();
|
||||||
|
|||||||
Reference in New Issue
Block a user