Skip to content

[iOS] Support for breakpoints with ignoreCount in iOS only #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"publisher": "Telerik",
"bugs": "https://github.com/NativeScript/nativescript-vscode-extension/issues",
"engines": {
"vscode": "^1.5.0"
"vscode": "^1.7.0"
},
"homepage": "https://www.nativescript.org/",
"categories": [
Expand All @@ -29,8 +29,8 @@
"source-map": "^0.5.3",
"xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master",
"universal-analytics": "^0.4.6",
"vscode-debugadapter": "^1.7.0",
"vscode-debugprotocol": "^1.7.0"
"vscode-debugadapter": "^1.14.0",
"vscode-debugprotocol": "^1.14.0"
},
"devDependencies": {
"@types/es6-collections": "^0.5.29",
Expand Down
2 changes: 1 addition & 1 deletion src/debug-adapter/connection/INSDebugConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export interface INSDebugConnection {

close(): void;

debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition?: string): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse>
debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition: string, ignoreCount: number): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse>

debugger_removeBreakpoint(breakpointId: string): Promise<WebKitProtocol.Response>

Expand Down
8 changes: 3 additions & 5 deletions src/debug-adapter/connection/androidConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,15 @@ export class AndroidConnection implements INSDebugConnection {
this._socket.close();
}

public debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition?: string): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse> {
//throw new Error("Not implemented");
//return this.sendMessage('Debugger.setBreakpointByUrl', <WebKitProtocol.Debugger.SetBreakpointByUrlParams>{ url, lineNumber, columnNumber });

public debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition: string, ignoreCount: number): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse> {
let that = this;
var requestParams = {
type: 'script',
target: that.inspectorUrlToV8Name(url),
line: lineNumber,
column: columnNumber,
condition: condition
condition: condition,
ignoreCount: ignoreCount
};

return this.request("setbreakpoint", requestParams)
Expand Down
4 changes: 2 additions & 2 deletions src/debug-adapter/connection/iosConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export class IosConnection implements INSDebugConnection {
return this.sendMessage('Debugger.setBreakpoint', <WebKitProtocol.Debugger.SetBreakpointParams>{ location, options: { condition: condition }});
}

public debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition?: string): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse> {
return this.sendMessage('Debugger.setBreakpointByUrl', <WebKitProtocol.Debugger.SetBreakpointByUrlParams>{ url: url, lineNumber: lineNumber, columnNumber: 0 /* a columnNumber different from 0 confuses the debugger */, options: { condition: condition }});
public debugger_setBreakpointByUrl(url: string, lineNumber: number, columnNumber: number, condition: string, ignoreCount: number): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse> {
return this.sendMessage('Debugger.setBreakpointByUrl', <WebKitProtocol.Debugger.SetBreakpointByUrlParams>{ url: url, lineNumber: lineNumber, columnNumber: 0 /* a columnNumber different from 0 confuses the debugger */, options: { condition: condition, ignoreCount: ignoreCount }});
}

public debugger_removeBreakpoint(breakpointId: string): Promise<WebKitProtocol.Response> {
Expand Down
14 changes: 12 additions & 2 deletions src/debug-adapter/webKitDebugAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
supportsFunctionBreakpoints: false,
supportsConditionalBreakpoints: true,
supportsEvaluateForHovers: false,
supportsHitConditionalBreakpoints: true, // TODO: Not working on Android
exceptionBreakpointFilters: [{
label: 'All Exceptions',
filter: 'all',
Expand All @@ -92,7 +93,16 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
label: 'Uncaught Exceptions',
filter: 'uncaught',
default: true
}]
}],
supportsStepBack: false,
supportsSetVariable: false, // TODO: Check if can be enabled
supportsRestartFrame: false, // TODO: Check if can be enabled
supportsGotoTargetsRequest: false, // TODO: Check if can be enabled
supportsStepInTargetsRequest: false, // TODO: Check if can be enabled
supportsCompletionsRequest: false, // TODO: Check if can be enabled
supportsModulesRequest: false, // TODO: Check if can be enabled
additionalModuleColumns: undefined, // TODO: Check if can be enabled
supportedChecksumAlgorithms: undefined // TODO: Check if can be enabled
}
}

Expand Down Expand Up @@ -377,7 +387,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
private _addBreakpoints(url: string, breakpoints: DebugProtocol.ISetBreakpointsArgs): Promise<WebKitProtocol.Debugger.SetBreakpointByUrlResponse[]> {
// Call setBreakpoint for all breakpoints in the script simultaneously
const responsePs = breakpoints.breakpoints
.map((b, i) => this._webKitConnection.debugger_setBreakpointByUrl(url, breakpoints.lines[i], breakpoints.cols ? breakpoints.cols[i] : 0, b.condition));
.map((b, i) => this._webKitConnection.debugger_setBreakpointByUrl(url, breakpoints.lines[i], breakpoints.cols ? breakpoints.cols[i] : 0, b.condition, parseInt(b.hitCondition) || 0));

// Join all setBreakpoint requests to a single promise
return Promise.all(responsePs);
Expand Down