Skip to content

Commit 9376402

Browse files
committed
fix lldb goto command
1 parent d222795 commit 9376402

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/backend/mi2/mi2lldb.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ export class MI2_LLDB extends MI2 {
6363
// LLDB parses the file differently than GDB...
6464
// GDB doesn't allow quoting only the file but only the whole argument
6565
// LLDB doesn't allow quoting the whole argument but rather only the file
66-
const target: string = '"' + (filename ? escape(filename) + ":" : "") + '"' + line;
66+
const target: string = (filename ? '"' + escape(filename) + '":' : "") + line;
6767
this.sendCliCommand("jump " + target).then(() => {
68+
this.emit("step-other", null);
6869
resolve(true);
6970
}, reject);
7071
});

src/mibase.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class MI2DebugSession extends DebugSession {
5252
this.miDebugger.on("breakpoint", this.handleBreakpoint.bind(this));
5353
this.miDebugger.on("step-end", this.handleBreak.bind(this));
5454
this.miDebugger.on("step-out-end", this.handleBreak.bind(this));
55+
this.miDebugger.on("step-other", this.handleBreak.bind(this));
5556
this.miDebugger.on("signal-stop", this.handlePause.bind(this));
5657
this.miDebugger.on("thread-created", this.threadCreatedEvent.bind(this));
5758
this.miDebugger.on("thread-exited", this.threadExitedEvent.bind(this));
@@ -116,9 +117,9 @@ export class MI2DebugSession extends DebugSession {
116117
this.sendEvent(event);
117118
}
118119

119-
protected handleBreak(info: MINode) {
120-
const event = new StoppedEvent("step", parseInt(info.record("thread-id")));
121-
(event as DebugProtocol.StoppedEvent).body.allThreadsStopped = info.record("stopped-threads") == "all";
120+
protected handleBreak(info?: MINode) {
121+
const event = new StoppedEvent("step", info ? parseInt(info.record("thread-id")) : 1);
122+
(event as DebugProtocol.StoppedEvent).body.allThreadsStopped = info ? info.record("stopped-threads") == "all" : true;
122123
this.sendEvent(event);
123124
}
124125

@@ -657,16 +658,16 @@ export class MI2DebugSession extends DebugSession {
657658
protected gotoTargetsRequest(response: DebugProtocol.GotoTargetsResponse, args: DebugProtocol.GotoTargetsArguments): void {
658659
this.miDebugger.goto(args.source.path, args.line).then(done => {
659660
response.body = {
660-
targets : [{
661-
id : 1,
662-
label : args.source.name,
661+
targets: [{
662+
id: 1,
663+
label: args.source.name,
663664
column: args.column,
664665
line : args.line
665666
}]
666667
};
667668
this.sendResponse(response);
668669
}, msg => {
669-
this.sendErrorResponse(response, 6, `Could not jump: ${msg}`);
670+
this.sendErrorResponse(response, 16, `Could not jump: ${msg}`);
670671
});
671672
}
672673

0 commit comments

Comments
 (0)