Skip to content

Commit

Permalink
Merge pull request #428 from HenryRiley0/bugfix
Browse files Browse the repository at this point in the history
fixing gdb check and type errors
  • Loading branch information
GitMensch authored Aug 21, 2024
2 parents f204573 + 25e1f28 commit 7d61f09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Versioning].

### Added

- fix gdb check error when debug beginning ([@henryriley0])
- fix implicitly type error in log message when build vsix ([@henryriley0])
- check for configured debugger before start to provide a nicer error message
([@GitMensch])

Expand Down Expand Up @@ -242,6 +244,7 @@ Versioning].
[@gentoo90]: https://github.com/gentoo90
[@gitmensch]: https://github.com/GitMensch
[@haronk]: https://github.com/HaronK
[@henryriley0]: https://github.com/HenryRiley0
[@jelleroets]: https://github.com/JelleRoets
[@karljs]: https://github.com/karljs
[@kvinwang]: https://github.com/kvinwang
Expand Down
6 changes: 3 additions & 3 deletions src/backend/mi2/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LogMessage {
protected logReplaceTest = /{([^}]*)}/g;
public logMsgBrkList: Breakpoint[] = [];

logMsgOutput(record){
logMsgOutput(record:any){
if ((record.type === 'console')) {
if(record.content.startsWith("$")){
const content = record.content;
Expand All @@ -54,7 +54,7 @@ class LogMessage {
}
}

logMsgProcess(parsed){
logMsgProcess(parsed:any){
this.logMsgBrkList.forEach((brk)=>{
if(parsed.outOfBandRecord[0].output[0][1] == "breakpoint-hit" && parsed.outOfBandRecord[0].output[2][1] == brk.id){
this.logMsgVar = brk?.logMessage;
Expand Down Expand Up @@ -626,7 +626,7 @@ export class MI2 extends EventEmitter implements IBackend {
return this.sendCommand("break-condition " + bkptNum + " " + condition);
}

setLogPoint(bkptNum, command): Thenable<any> {
setLogPoint(bkptNum:number, command:string): Thenable<any> {
const regex = /{([a-z0-9A-Z-_\.\>\&\*\[\]]*)}/gm;
let m:RegExpExecArray;
let commands:string = "";
Expand Down
4 changes: 2 additions & 2 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class GDBDebugSession extends MI2DebugSession {

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

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

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

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

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

protected override attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
const dbgCommand = args.magomipath || "mago-mi";
if (this.checkCommand(dbgCommand)) {
if (!this.checkCommand(dbgCommand)) {
this.sendErrorResponse(response, 104, `Configured debugger ${dbgCommand} not found.`);
return;
}
Expand Down

0 comments on commit 7d61f09

Please sign in to comment.