Skip to content

Commit d222795

Browse files
committed
add filename quoting in goto request
1 parent 31376fa commit d222795

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/backend/mi2/mi2.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ export class MI2 extends EventEmitter implements IBackend {
482482
if (trace)
483483
this.log("stderr", "goto");
484484
return new Promise((resolve, reject) => {
485-
const target: string = (filename ? filename + ":" : "") + line;
485+
const target: string = '"' + (filename ? escape(filename) + ":" : "") + line + '"';
486486
this.sendCommand("break-insert -t " + target).then(() => {
487487
this.sendCommand("exec-jump " + target).then((info) => {
488488
resolve(info.resultRecords.resultClass == "running");

src/backend/mi2/mi2lldb.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ export class MI2_LLDB extends MI2 {
6060

6161
goto(filename: string, line: number): Thenable<Boolean> {
6262
return new Promise((resolve, reject) => {
63-
const target: string = (filename ? filename + ":" : "") + line;
63+
// LLDB parses the file differently than GDB...
64+
// GDB doesn't allow quoting only the file but only the whole argument
65+
// LLDB doesn't allow quoting the whole argument but rather only the file
66+
const target: string = '"' + (filename ? escape(filename) + ":" : "") + '"' + line;
6467
this.sendCliCommand("jump " + target).then(() => {
6568
resolve(true);
6669
}, reject);

0 commit comments

Comments
 (0)