Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions extension/debug/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ class MojoDebugAdapterDescriptorFactory
}
this.logger.info(`Using the SDK ${sdk.version} for the debug session`);

return new vscode.DebugAdapterExecutable(sdk.dapPath, [
'--repl-mode',
'variable',
'--pre-init-command',
`?!plugin load '${sdk.lldbPluginPath}'`,
]);
this.logger.debug('env', sdk.getProcessEnv());

return new vscode.DebugAdapterExecutable(
sdk.dapPath,
['--repl-mode', 'variable'],
{
env: sdk.getProcessEnv(),
},
);
}
}

Expand Down Expand Up @@ -264,6 +267,7 @@ class MojoDebugConfigurationResolver

// This setting shortens the length of address strings.
const initCommands = [
`?!plugin load '${sdk.lldbPluginPath}'`,
'?settings set target.show-hex-variable-values-with-leading-zeroes false',
// FIXME(#23274): remove this when we properly emit the opt flag.
'?settings set target.process.optimization-warnings false',
Expand Down
8 changes: 7 additions & 1 deletion extension/pyenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class HomeSDK extends SDK {
mojoPath: string,
visualizersPath: string,
lldbPath: string,
private prefixPath?: string,
) {
super(
logger,
Expand All @@ -132,8 +133,10 @@ class HomeSDK extends SDK {

public override getProcessEnv(withTelemetry: boolean = true) {
return {
...super.getProcessEnv(withTelemetry),
MODULAR_HOME: this.homePath,
MODULAR_TELEMETRY_ENABLED: withTelemetry ? 'true' : 'false',
// HACK: Set CONDA_PREFIX to allow debugger wrappers to work
CONDA_PREFIX: this.prefixPath,
};
}
}
Expand Down Expand Up @@ -214,6 +217,7 @@ export class PythonEnvironmentManager extends DisposableContext {
return this.createSDKFromHomePath(
SDKKind.Environment,
path.join(env.executable.sysPrefix, 'share', 'max'),
env.executable.sysPrefix,
);
} else {
this.logger.info(
Expand Down Expand Up @@ -315,6 +319,7 @@ export class PythonEnvironmentManager extends DisposableContext {
public async createSDKFromHomePath(
kind: SDKKind,
homePath: string,
prefixPath?: string,
): Promise<SDK | undefined> {
const modularCfgPath = path.join(homePath, 'modular.cfg');
const decoder = new TextDecoder();
Expand Down Expand Up @@ -372,6 +377,7 @@ export class PythonEnvironmentManager extends DisposableContext {
config['mojo-max']['driver_path'],
config['mojo-max']['lldb_visualizers_path'],
config['mojo-max']['lldb_path'],
prefixPath,
);
} catch (e) {
await this.displaySDKError(
Expand Down