Skip to content

Commit

Permalink
add "override" to methods
Browse files Browse the repository at this point in the history
  • Loading branch information
oltolm authored and WebFreak001 committed Mar 13, 2024
1 parent 04068e9 commit 6942703
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/backend/mi2/mi2mago.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Stack } from "../backend";
import { MINode } from "../mi_parse";

export class MI2_Mago extends MI2_LLDB {
getStack(startFrame: number, maxLevels: number, thread: number): Promise<Stack[]> {
override getStack(startFrame: number, maxLevels: number, thread: number): Promise<Stack[]> {
return new Promise((resolve, reject) => {
const command = "stack-list-frames";
this.sendCommand(command).then((result) => {
Expand Down
6 changes: 3 additions & 3 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface AttachRequestArguments extends DebugProtocol.AttachRequestArgum
}

class GDBDebugSession extends MI2DebugSession {
protected initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
protected override initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
response.body.supportsGotoTargetsRequest = true;
response.body.supportsHitConditionalBreakpoints = true;
response.body.supportsConfigurationDoneRequest = true;
Expand All @@ -52,7 +52,7 @@ class GDBDebugSession extends MI2DebugSession {
this.sendResponse(response);
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
const dbgCommand = args.gdbpath || "gdb";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand Down Expand Up @@ -98,7 +98,7 @@ class GDBDebugSession extends MI2DebugSession {
}
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
const dbgCommand = args.gdbpath || "gdb";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand Down
6 changes: 3 additions & 3 deletions src/lldb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface AttachRequestArguments extends DebugProtocol.AttachRequestArgum
}

class LLDBDebugSession extends MI2DebugSession {
protected initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
protected override initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
response.body.supportsGotoTargetsRequest = true;
response.body.supportsHitConditionalBreakpoints = true;
response.body.supportsConfigurationDoneRequest = true;
Expand All @@ -47,7 +47,7 @@ class LLDBDebugSession extends MI2DebugSession {
this.sendResponse(response);
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
const dbgCommand = args.lldbmipath || "lldb-mi";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand Down Expand Up @@ -93,7 +93,7 @@ class LLDBDebugSession extends MI2DebugSession {
}
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
const dbgCommand = args.lldbmipath || "lldb-mi";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand Down
6 changes: 3 additions & 3 deletions src/mago.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MagoDebugSession extends MI2DebugSession {
super(debuggerLinesStartAt1, isServer);
}

protected initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
protected override initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {
response.body.supportsHitConditionalBreakpoints = true;
response.body.supportsConfigurationDoneRequest = true;
response.body.supportsConditionalBreakpoints = true;
Expand All @@ -49,7 +49,7 @@ class MagoDebugSession extends MI2DebugSession {
return 0;
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
protected override launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
const dbgCommand = args.magomipath || "mago-mi";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand All @@ -73,7 +73,7 @@ class MagoDebugSession extends MI2DebugSession {
});
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
const dbgCommand = args.magomipath || "mago-mi";
if (this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
Expand Down
38 changes: 19 additions & 19 deletions src/mibase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class MI2DebugSession extends DebugSession {
this.quitEvent();
}

protected disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments): void {
protected override disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments): void {
if (this.attached)
this.miDebugger.detach();
else
Expand All @@ -192,7 +192,7 @@ export class MI2DebugSession extends DebugSession {
this.sendResponse(response);
}

protected async setVariableRequest(response: DebugProtocol.SetVariableResponse, args: DebugProtocol.SetVariableArguments): Promise<void> {
protected override async setVariableRequest(response: DebugProtocol.SetVariableResponse, args: DebugProtocol.SetVariableArguments): Promise<void> {
try {
if (this.useVarObjects) {
let name = args.name;
Expand All @@ -219,7 +219,7 @@ export class MI2DebugSession extends DebugSession {
}
}

protected setFunctionBreakPointsRequest(response: DebugProtocol.SetFunctionBreakpointsResponse, args: DebugProtocol.SetFunctionBreakpointsArguments): void {
protected override setFunctionBreakPointsRequest(response: DebugProtocol.SetFunctionBreakpointsResponse, args: DebugProtocol.SetFunctionBreakpointsArguments): void {
const all = [];
args.breakpoints.forEach(brk => {
all.push(this.miDebugger.addBreakPoint({ raw: brk.name, condition: brk.condition, countCondition: brk.hitCondition }));
Expand All @@ -239,7 +239,7 @@ export class MI2DebugSession extends DebugSession {
});
}

protected setBreakPointsRequest(response: DebugProtocol.SetBreakpointsResponse, args: DebugProtocol.SetBreakpointsArguments): void {
protected override setBreakPointsRequest(response: DebugProtocol.SetBreakpointsResponse, args: DebugProtocol.SetBreakpointsArguments): void {
let path = args.source.path;
if (this.isSSH) {
// convert local path to ssh path
Expand Down Expand Up @@ -269,7 +269,7 @@ export class MI2DebugSession extends DebugSession {
});
}

protected threadsRequest(response: DebugProtocol.ThreadsResponse): void {
protected override threadsRequest(response: DebugProtocol.ThreadsResponse): void {
if (!this.miDebugger) {
this.sendResponse(response);
return;
Expand Down Expand Up @@ -300,7 +300,7 @@ export class MI2DebugSession extends DebugSession {
return [frameId & 0xffff, frameId >> 16];
}

protected stackTraceRequest(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments): void {
protected override stackTraceRequest(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments): void {
this.miDebugger.getStack(args.startFrame, args.levels, args.threadId).then(stack => {
const ret: StackFrame[] = [];
stack.forEach(element => {
Expand Down Expand Up @@ -334,7 +334,7 @@ export class MI2DebugSession extends DebugSession {
});
}

protected configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
protected override configurationDoneRequest(response: DebugProtocol.ConfigurationDoneResponse, args: DebugProtocol.ConfigurationDoneArguments): void {
const promises: Thenable<any>[] = [];
let entryPoint: string | undefined = undefined;
let runToStart: boolean = false;
Expand Down Expand Up @@ -403,7 +403,7 @@ export class MI2DebugSession extends DebugSession {
});
}

protected scopesRequest(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments): void {
protected override scopesRequest(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments): void {
const scopes = new Array<Scope>();
const [threadId, level] = this.frameIdToThreadAndLevel(args.frameId);

Expand All @@ -430,7 +430,7 @@ export class MI2DebugSession extends DebugSession {
this.sendResponse(response);
}

protected async variablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): Promise<void> {
protected override async variablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): Promise<void> {
const variables: DebugProtocol.Variable[] = [];
const id: VariableScope | string | VariableObject | ExtendedVariable = this.variableHandles.get(args.variablesReference);

Expand Down Expand Up @@ -649,63 +649,63 @@ export class MI2DebugSession extends DebugSession {
}
}

protected pauseRequest(response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments): void {
protected override pauseRequest(response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments): void {
this.miDebugger.interrupt().then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 3, `Could not pause: ${msg}`);
});
}

protected reverseContinueRequest(response: DebugProtocol.ReverseContinueResponse, args: DebugProtocol.ReverseContinueArguments): void {
protected override reverseContinueRequest(response: DebugProtocol.ReverseContinueResponse, args: DebugProtocol.ReverseContinueArguments): void {
this.miDebugger.continue(true).then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 2, `Could not continue: ${msg}`);
});
}

protected continueRequest(response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments): void {
protected override continueRequest(response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments): void {
this.miDebugger.continue().then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 2, `Could not continue: ${msg}`);
});
}

protected stepBackRequest(response: DebugProtocol.StepBackResponse, args: DebugProtocol.StepBackArguments): void {
protected override stepBackRequest(response: DebugProtocol.StepBackResponse, args: DebugProtocol.StepBackArguments): void {
this.miDebugger.step(true).then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 4, `Could not step back: ${msg} - Try running 'target record-full' before stepping back`);
});
}

protected stepInRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
protected override stepInRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
this.miDebugger.step().then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 4, `Could not step in: ${msg}`);
});
}

protected stepOutRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
protected override stepOutRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
this.miDebugger.stepOut().then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 5, `Could not step out: ${msg}`);
});
}

protected nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
protected override nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {
this.miDebugger.next().then(done => {
this.sendResponse(response);
}, msg => {
this.sendErrorResponse(response, 6, `Could not step over: ${msg}`);
});
}

protected evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void {
protected override evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void {
const [threadId, level] = this.frameIdToThreadAndLevel(args.frameId);
if (args.context == "watch" || args.context == "hover") {
this.miDebugger.evalExpression(args.expression, threadId, level).then((res) => {
Expand Down Expand Up @@ -736,7 +736,7 @@ export class MI2DebugSession extends DebugSession {
}
}

protected gotoTargetsRequest(response: DebugProtocol.GotoTargetsResponse, args: DebugProtocol.GotoTargetsArguments): void {
protected override gotoTargetsRequest(response: DebugProtocol.GotoTargetsResponse, args: DebugProtocol.GotoTargetsArguments): void {
const path: string = this.isSSH ? this.sourceFileMap.toRemotePath(args.source.path) : args.source.path;
this.miDebugger.goto(path, args.line).then(done => {
response.body = {
Expand All @@ -753,7 +753,7 @@ export class MI2DebugSession extends DebugSession {
});
}

protected gotoRequest(response: DebugProtocol.GotoResponse, args: DebugProtocol.GotoArguments): void {
protected override gotoRequest(response: DebugProtocol.GotoResponse, args: DebugProtocol.GotoArguments): void {
this.sendResponse(response);
}

Expand Down

0 comments on commit 6942703

Please sign in to comment.