Skip to content

Commit 15f3727

Browse files
committed
Implement support to Debugger Properties, then we can pass this information to BrowserDebugProxy and give the Wasm programmer a better debugging experience.
1 parent f314b55 commit 15f3727

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

src/adapter/debugAdapter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ export class DebugAdapter implements IDisposable {
117117
this.dap.on('setExcludedCallers', params => this._onSetExcludedCallers(params));
118118
this.dap.on('saveDiagnosticLogs', ({ toFile }) => this._saveDiagnosticLogs(toFile));
119119
this.dap.on('setSourceMapStepping', params => this._setSourceMapStepping(params));
120+
this.dap.on('setDebuggerProperty', params => this._setDebuggerProperty(params));
121+
}
122+
123+
private _setDebuggerProperty(params: Dap.SetDebuggerPropertyParams) {
124+
this._thread?.cdp().DotnetDebugger.setDebuggerProperty(params);
120125
}
121126

122127
private _setSourceMapStepping({
@@ -214,6 +219,7 @@ export class DebugAdapter implements IDisposable {
214219
supportsBreakpointLocationsRequest: true,
215220
supportsClipboardContext: true,
216221
supportsExceptionFilterOptions: true,
222+
supportsDebuggerProperties: true,
217223
//supportsDataBreakpoints: false,
218224
//supportsDisassembleRequest: false,
219225
};

src/cdp/api.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export namespace Cdp {
4040
DOMDebugger: DOMDebuggerApi;
4141
DOMSnapshot: DOMSnapshotApi;
4242
DOMStorage: DOMStorageApi;
43+
DotnetDebugger: DotnetDebuggerApi;
4344
Emulation: EmulationApi;
4445
EventBreakpoints: EventBreakpointsApi;
4546
Fetch: FetchApi;
@@ -9639,6 +9640,31 @@ export namespace Cdp {
96399640
export type Item = string[];
96409641
}
96419642

9643+
/**
9644+
* Methods and events of the 'DotnetDebuggerApi' domain.
9645+
*/
9646+
export interface DotnetDebuggerApi {
9647+
/**
9648+
* Set debugger property value.
9649+
*/
9650+
setDebuggerProperty(params: DotnetDebugger.SetDebuggerPropertyParams): void;
9651+
}
9652+
9653+
/**
9654+
* Types of the 'DotnetDebugger' domain.
9655+
*/
9656+
export namespace DotnetDebugger {
9657+
/**
9658+
* Parameters of the 'DotnetDebugger.setDebuggerProperty' method.
9659+
*/
9660+
export interface SetDebuggerPropertyParams {
9661+
/**
9662+
* Whether to enable to disable debugger property.
9663+
*/
9664+
name: string;
9665+
enabled: boolean;
9666+
}
9667+
}
96429668
/**
96439669
* Methods and events of the 'Emulation' domain.
96449670
*/

src/dap/api.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,11 @@ export namespace Dap {
10991099
setSourceMapSteppingRequest(
11001100
params: SetSourceMapSteppingParams,
11011101
): Promise<SetSourceMapSteppingResult>;
1102+
1103+
/**
1104+
* Configures whether source map stepping is enabled.
1105+
*/
1106+
on(request: 'setDebuggerProperty', handler: (params: SetDebuggerPropertyParams) => void): void;
11021107
}
11031108

11041109
export interface TestApi {
@@ -3158,6 +3163,18 @@ export namespace Dap {
31583163
breakpoints: Breakpoint[];
31593164
}
31603165

3166+
export interface SetDebuggerPropertyParams {
3167+
/**
3168+
* The name of the property
3169+
*/
3170+
name: string;
3171+
3172+
/**
3173+
* The value of the property
3174+
*/
3175+
enabled: boolean;
3176+
}
3177+
31613178
export interface SetExceptionBreakpointsParams {
31623179
/**
31633180
* Set of exception filters specified by their ID. The set of all possible exception filters is defined by the 'exceptionBreakpointFilters' capability. The 'filter' and 'filterOptions' sets are additive.
@@ -4779,6 +4796,11 @@ export namespace Dap {
47794796
* The debug adapter supports the 'singleThread' property on the execution requests ('continue', 'next', 'stepIn', 'stepOut', 'reverseContinue', 'stepBack').
47804797
*/
47814798
supportsSingleThreadExecutionRequests?: boolean;
4799+
4800+
/**
4801+
* The debug adapter supports receiving debugger properties.
4802+
*/
4803+
supportsDebuggerProperties?: boolean;
47824804
}
47834805

47844806
/**

0 commit comments

Comments
 (0)