Ivan
Ivan

Reputation: 2332

Where are the LLVM environment variables or how is the LLVM environment configured?

For context, I have a Mac that I've used for development at my job using various custom build scripts. I'm now attempting to use the same machine to play around with some personal Xcode projects.

As a first step I create a new "Single View App" project in Xcode 11.3.1 and try to run it on my connected iPhone device or iOS Simulator.

I get the following error:

error: the replacement path doesn't exist: "/path/to/old/work/project/"

As far as I've been able to figure out the error comes from OptionValuePathMappings.cpp in LLVM

So it's probably hit during initialization of the LLDB interactive debugger.

I'd like to know where the value of the replacement path comes from to figure out how to unset it for my personal projects.

Is there a command to display the start-up arguments to lldb? How does Xcode configure lldb?

Upvotes: 2

Views: 1119

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27110

lldb has a setting - target.source-map which is used when you have built a binary from sources in location A, and want to debug it with the sources moved to location B. Since the debug information records absolute paths, you need to tell lldb how to map the paths in the debug information to their current location.

The error is warning you that you have a target.source-map setting somewhere that is pointing to a source destination (location B) which doesn't exist. It would be a command, of the form:

settings set target.source-map /Some/Build/Path /path/to/old/work/project

When run under Xcode, the user customizations for lldb come from dot-files in the same way command-line lldb does, with the exception that command line lldb always reads from ~/.lldbinit but when run under Xcode, it will prefer ~/.lldbinit-Xcode if it exists.

This setting isn't read from environment variables, it would have to be a direct command issued somewhere. Xcode doesn't set this variable internally when debugging, so it must be in a startup file somewhere.

Upvotes: 4

Related Questions