-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Description
VSCode opens the same file with two path:
/Volumes/a/b/x.cpp/Volumes/a/b/out/debug/../..x.cpp.
Repro:
- launch config:
{
"type": "lldb-mi",
"request": "launch",
"name": "webfreak.debug lldb-mi",
"target": "./out/debug/Heap/Heap.test.exe",
"cwd": "${workspaceRoot}",
"lldbmipath": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi",
"printCalls": true,
"showDevDebugOutput": true
}
- version:
/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-mi --version
Version: GNU gdb (GDB) 7.4
(This is a MI stub on top of LLDB and not GDB)
- Insert a breakpoint into the test.
- Run the test => It will hit the breakpoint and open the same file with different path(
../..).
I made some proof of concept changes in here which seems fixes the problem:
function normalize(value: any) {
if (Array.isArray(value)) {
if (value.length === 2 && value[0] === 'fullname') {
value[1] = path.normalize(value[1]);
} else {
(<any[]>value).forEach((v: any) => { normalize(v); });
}
} else if (typeof value == 'object') {
for (const prop in value) {
normalize(value[prop]);
}
}
}
export class MINode implements MIInfo {
token: number;
outOfBandRecord: { isStream: boolean, type: string, asyncClass: string, output: [string, any][], content: string }[];
resultRecords: { resultClass: string, results: [string, any][] };
constructor(token: number, info: { isStream: boolean, type: string, asyncClass: string, output: [string, any][], content: string }[], result: { resultClass: string, results: [string, any][] }) {
this.token = token;
normalize(info);
this.outOfBandRecord = info;
normalize(result);
this.resultRecords = result;
}
...
Maybe it should be handled in vscode not in the extension.
Metadata
Metadata
Assignees
Labels
No labels

