Skip to content

Commit 2ae2335

Browse files
committed
debugger: pass along SDKROOT for the launch of the debugger
This is used by the debugger to locate the Swift module information for the debugger. Without this, we would fail to setup the Swift scratch space in LLDB, which then results in the failure of the debugger and subsequently the DAP. Fixes: #250
1 parent 4214672 commit 2ae2335

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/debugger/launch.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ export function createTestConfiguration(
154154
if (xcTestPath === undefined) {
155155
return null;
156156
}
157+
const sdkroot = configuration.sdk === "" ? process.env.SDKROOT : configuration.sdk;
158+
if (sdkroot === undefined) {
159+
return null;
160+
}
157161
return {
158162
type: "lldb",
159163
request: "launch",
@@ -164,6 +168,7 @@ export function createTestConfiguration(
164168
Path: `${xcTestPath};${process.env.Path}`,
165169
...testEnv,
166170
},
171+
preRunCommands: [`settings set target.sdk-path ${sdkroot}`],
167172
preLaunchTask: `swift: Build All${nameSuffix}`,
168173
};
169174
} else {

0 commit comments

Comments
 (0)