<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/lldb/source/Utility/XcodeSDK.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lldb][Darwin] revert change to lang_opts.BuiltinHeadersInSystemModules (#145864)</title>
<updated>2025-06-26T10:56:50+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>c_zablit@apple.com</email>
</author>
<published>2025-06-26T10:56:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9ae41f017d8e6264ded66e2e476efb1dc2a280a1'/>
<id>9ae41f017d8e6264ded66e2e476efb1dc2a280a1</id>
<content type='text'>
Revert the changes made in the following PRs as they are causing bot
failures:

- https://github.com/llvm/llvm-project/pull/145744
- https://github.com/llvm/llvm-project/pull/144913</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert the changes made in the following PRs as they are causing bot
failures:

- https://github.com/llvm/llvm-project/pull/145744
- https://github.com/llvm/llvm-project/pull/144913</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][darwin] force BuiltinHeadersInSystemModules to be always false (#144913)</title>
<updated>2025-06-25T18:18:07+00:00</updated>
<author>
<name>Charles Zablit</name>
<email>c_zablit@apple.com</email>
</author>
<published>2025-06-25T18:18:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=487581b826a5339410aaf306eafedc7b806b25e3'/>
<id>487581b826a5339410aaf306eafedc7b806b25e3</id>
<content type='text'>
`SDKSupportsBuiltinModules` always returns true on newer versions of
Darwin based OS. The only way for this call to return `false` would be
to have a version mismatch between lldb and the SDK (recent lldb
manually installed on macOS 14 for instance).

This patch removes this check and hardcodes the value of
`BuiltinHeadersInSystemModules` to `false`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`SDKSupportsBuiltinModules` always returns true on newer versions of
Darwin based OS. The only way for this call to return `false` would be
to have a version mismatch between lldb and the SDK (recent lldb
manually installed on macOS 14 for instance).

This patch removes this check and hardcodes the value of
`BuiltinHeadersInSystemModules` to `false`.</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][XcodeSDK] Simplify logic that adjusts sysroot during XcodeSDK merging (#130640)</title>
<updated>2025-03-11T08:13:05+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-03-11T08:13:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cdd560eead457bcc6dbb28ef88d868bc68cfd7e6'/>
<id>cdd560eead457bcc6dbb28ef88d868bc68cfd7e6</id>
<content type='text'>
The `DW_AT_APPLE_sdk` should always be equal to the filename of the
`DW_AT_LLVM_sysroot`. We can use this property to simplify
`XcodeSDK::Merge` to no longer manually adjust the sysroot filename.
Instead we simply update the sysroot filename with merged SDK name.

This should be an NFC change.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `DW_AT_APPLE_sdk` should always be equal to the filename of the
`DW_AT_LLVM_sysroot`. We can use this property to simplify
`XcodeSDK::Merge` to no longer manually adjust the sysroot filename.
Instead we simply update the sysroot filename with merged SDK name.

This should be an NFC change.</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[lldb][HostInfoMacOSX] Try to use DW_AT_LLVM_sysroot instead of xcrun when looking up SDK" (#129621)"</title>
<updated>2025-03-04T10:24:08+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-03-04T10:12:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=77a8770d4976e086f36004a6b8bf09e76d981451'/>
<id>77a8770d4976e086f36004a6b8bf09e76d981451</id>
<content type='text'>
This reverts commit 6041c745f32e8fd60ed24e29e7d919d8d1c87ca6.

Relands the original patch with the test-case data fixed. Weirldy the PR CI
didn't seem to run the unit-tests? In any case, the problem was an
incorrect expectation in the test-case data. Since we have both public
and internal SDK in that test-case, we should `expect_mismatch` to be
`true`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 6041c745f32e8fd60ed24e29e7d919d8d1c87ca6.

Relands the original patch with the test-case data fixed. Weirldy the PR CI
didn't seem to run the unit-tests? In any case, the problem was an
incorrect expectation in the test-case data. Since we have both public
and internal SDK in that test-case, we should `expect_mismatch` to be
`true`.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb][HostInfoMacOSX] Try to use DW_AT_LLVM_sysroot instead of xcrun when looking up SDK" (#129621)</title>
<updated>2025-03-04T00:55:01+00:00</updated>
<author>
<name>Augusto Noronha</name>
<email>anoronha@apple.com</email>
</author>
<published>2025-03-04T00:55:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6041c745f32e8fd60ed24e29e7d919d8d1c87ca6'/>
<id>6041c745f32e8fd60ed24e29e7d919d8d1c87ca6</id>
<content type='text'>
Reverts llvm/llvm-project#128712


```
******************** TEST 'lldb-unit :: SymbolFile/DWARF/./SymbolFileDWARFTests/10/14' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests-lldb-unit-1021-10-14.json GTEST_SHUFFLE=1 GTEST_TOTAL_SHARDS=14 GTEST_SHARD_INDEX=10 GTEST_RANDOM_SEED=62233 /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests
--

Script:
--
/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests --gtest_filter=SDKPathParsingTests/SDKPathParsingMultiparamTests.TestSDKPathFromDebugInfo/6
--
/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp:265: Failure
Expected equality of these values:
  found_mismatch
    Which is: true
  expect_mismatch
    Which is: false


/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp:265
Expected equality of these values:
  found_mismatch
    Which is: true
  expect_mismatch
    Which is: false
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#128712


```
******************** TEST 'lldb-unit :: SymbolFile/DWARF/./SymbolFileDWARFTests/10/14' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests-lldb-unit-1021-10-14.json GTEST_SHUFFLE=1 GTEST_TOTAL_SHARDS=14 GTEST_SHARD_INDEX=10 GTEST_RANDOM_SEED=62233 /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests
--

Script:
--
/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/unittests/SymbolFile/DWARF/./SymbolFileDWARFTests --gtest_filter=SDKPathParsingTests/SDKPathParsingMultiparamTests.TestSDKPathFromDebugInfo/6
--
/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp:265: Failure
Expected equality of these values:
  found_mismatch
    Which is: true
  expect_mismatch
    Which is: false


/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/unittests/SymbolFile/DWARF/XcodeSDKModuleTests.cpp:265
Expected equality of these values:
  found_mismatch
    Which is: true
  expect_mismatch
    Which is: false
```</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][HostInfoMacOSX] Try to use DW_AT_LLVM_sysroot instead of xcrun when looking up SDK (#128712)</title>
<updated>2025-03-03T22:16:30+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2025-03-03T22:16:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=da293b850be3fc5b2047769f55823e41b07625c9'/>
<id>da293b850be3fc5b2047769f55823e41b07625c9</id>
<content type='text'>
`GetSDKRoot` uses `xcrun` to find an SDK root path for a given SDK
version string. But if the SDK doesn't exist in the Xcode installations,
but instead lives in the `CommandLineTools`, `xcrun` will fail to find
it. Negative searches for an SDK path cost a lot (a few seconds) each
time `xcrun` is invoked. We do cache negative results in
`find_cached_path` inside LLDB, but we would still pay the price on
every new debug session the first time we evaluate an expression. This
doesn't only cause a noticable delay in running the expression, but also
generates following error:
```
error: Error while searching for Xcode SDK: timed out waiting for shell command to complete
(int) $0 = 42
```

In this patch we avoid these possibly expensive calls to `xcrun` by
checking the `DW_AT_LLVM_sysroot`, and if it exists, using that as the
SDK path. We need an explicit check for the `CommandLineTools` path
before we call `RegisterXcodeSDK`, because that will try to call
`xcrun`. This won't prevent other uses of `GetSDKRoot` popping up that
cause us to make expensive `xcrun` calls, but for now this addresses the
regression in the expression evaluator. We also had to adjust the
`XcodeSDK::Merge` logic to update the sysroot. There is one case for
which this wouldn't make sense: if a CU was compiled with
`CommandLineTools` and a different one with an older internal SDK, in
that case we would update the `CommandLineTools` sysroot with a
`.Internal.sdk` prefix, which won't possibly exist for
`CommandLineTools`. I added a unit-test for this. Not sure if we want to
explicitly detect and disallow this, given it's quite a niche scenario.

rdar://113619904
rdar://113619723</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`GetSDKRoot` uses `xcrun` to find an SDK root path for a given SDK
version string. But if the SDK doesn't exist in the Xcode installations,
but instead lives in the `CommandLineTools`, `xcrun` will fail to find
it. Negative searches for an SDK path cost a lot (a few seconds) each
time `xcrun` is invoked. We do cache negative results in
`find_cached_path` inside LLDB, but we would still pay the price on
every new debug session the first time we evaluate an expression. This
doesn't only cause a noticable delay in running the expression, but also
generates following error:
```
error: Error while searching for Xcode SDK: timed out waiting for shell command to complete
(int) $0 = 42
```

In this patch we avoid these possibly expensive calls to `xcrun` by
checking the `DW_AT_LLVM_sysroot`, and if it exists, using that as the
SDK path. We need an explicit check for the `CommandLineTools` path
before we call `RegisterXcodeSDK`, because that will try to call
`xcrun`. This won't prevent other uses of `GetSDKRoot` popping up that
cause us to make expensive `xcrun` calls, but for now this addresses the
regression in the expression evaluator. We also had to adjust the
`XcodeSDK::Merge` logic to update the sysroot. There is one case for
which this wouldn't make sense: if a CU was compiled with
`CommandLineTools` and a different one with an older internal SDK, in
that case we would update the `CommandLineTools` sysroot with a
`.Internal.sdk` prefix, which won't possibly exist for
`CommandLineTools`. I added a unit-test for this. Not sure if we want to
explicitly detect and disallow this, given it's quite a niche scenario.

rdar://113619904
rdar://113619723</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[lldb][ClangExpressionParser] Set BuiltinHeadersInSystemModules depending on SDK version (#102309)" (#102497)</title>
<updated>2024-08-09T08:43:08+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2024-08-09T08:43:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3fffa6d486ecedaf639927a448701df9fdc19a34'/>
<id>3fffa6d486ecedaf639927a448701df9fdc19a34</id>
<content type='text'>
Depends on https://github.com/llvm/llvm-project/pull/102488

This reverts commit
https://github.com/llvm/llvm-project/commit/cf56e265e4b74799aee72a04b634fcc261078084.

The original change was reverted because it was causing linker failures
in the unit-tests:
```
Undefined symbols for architecture arm64:
  "lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(lldb_private::Module&amp;)",
referenced from:
      lldb_private::ClangExpressionParser::ClangExpressionParser(lldb_private::ExecutionContextScope*,
lldb_private::Expression&amp;, bool,
std::__1::vector&lt;std::__1::basic_string&lt;char,
std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt;&gt;,
std::__1::allocator&lt;std::__1::basic_string&lt;char,
std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt;&gt;&gt;&gt;,
std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;,
std::__1::allocator&lt;char&gt;&gt;) in
liblldbPluginExpressionParserClang.a[11](ClangExpressionParser.cpp.o)
ld: symbol(s) not found for architecture arm64
c++: error: linker command failed with exit code 1 (use -v to see
invocation)
```

The relanded version differs only in the fact that we now use the
generic `Platform` abstraction to get to `GetSDKPathFromDebugInfo`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Depends on https://github.com/llvm/llvm-project/pull/102488

This reverts commit
https://github.com/llvm/llvm-project/commit/cf56e265e4b74799aee72a04b634fcc261078084.

The original change was reverted because it was causing linker failures
in the unit-tests:
```
Undefined symbols for architecture arm64:
  "lldb_private::PlatformDarwin::GetSDKPathFromDebugInfo(lldb_private::Module&amp;)",
referenced from:
      lldb_private::ClangExpressionParser::ClangExpressionParser(lldb_private::ExecutionContextScope*,
lldb_private::Expression&amp;, bool,
std::__1::vector&lt;std::__1::basic_string&lt;char,
std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt;&gt;,
std::__1::allocator&lt;std::__1::basic_string&lt;char,
std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt;&gt;&gt;&gt;,
std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;,
std::__1::allocator&lt;char&gt;&gt;) in
liblldbPluginExpressionParserClang.a[11](ClangExpressionParser.cpp.o)
ld: symbol(s) not found for architecture arm64
c++: error: linker command failed with exit code 1 (use -v to see
invocation)
```

The relanded version differs only in the fact that we now use the
generic `Platform` abstraction to get to `GetSDKPathFromDebugInfo`.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[lldb][ClangExpressionParser] Set BuiltinHeadersInSystemModules depending on SDK version (#102309)"</title>
<updated>2024-08-08T00:35:17+00:00</updated>
<author>
<name>Jason Molenda</name>
<email>jmolenda@apple.com</email>
</author>
<published>2024-08-08T00:35:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf56e265e4b74799aee72a04b634fcc261078084'/>
<id>cf56e265e4b74799aee72a04b634fcc261078084</id>
<content type='text'>
This reverts commit 1cbcf74083e92021472ec9644b88418f377ce550.

unittests do not build because liblldbPluginExpressionParserClang.a now
depends on liblldbPluginPlatformMacOSX.a when built on macOS, reverting
until we can straighten out the dependency.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 1cbcf74083e92021472ec9644b88418f377ce550.

unittests do not build because liblldbPluginExpressionParserClang.a now
depends on liblldbPluginPlatformMacOSX.a when built on macOS, reverting
until we can straighten out the dependency.
</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb][ClangExpressionParser] Set BuiltinHeadersInSystemModules depending on SDK version (#102309)</title>
<updated>2024-08-07T22:59:58+00:00</updated>
<author>
<name>Michael Buch</name>
<email>michaelbuch12@gmail.com</email>
</author>
<published>2024-08-07T22:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1cbcf74083e92021472ec9644b88418f377ce550'/>
<id>1cbcf74083e92021472ec9644b88418f377ce550</id>
<content type='text'>
This patch changes the way we initialize `BuiltinHeadersInSystemModules`
which is one of the flags controlling Clang's behaviour when the Darwin
module is split into more fine-grained modules. The
ClangExpressionParser currently unconditionally sets
`-fbuiltin-headers-in-system-modules` when evaluating expressions with
the `target.import-std-module` setting. This flag should, however, be
set depending on the SDK version (which is what the Clang Darwin
toolchain does).

Unfortunately, the compiler instance that we create with
`ClangExpressionParser` never consults the Clang driver, and thus
doesn't correctly infer `BuiltinHeadersInSystemModules`. Note, this
isn't an issue with the `CompilerInstance` that the
`ClangModulesDeclVendor` creates because it uses the `createInovcation`
API, which calls into `Darwin::addClangTargetOptions`.

This patch mimicks how `sdkSupportsBuiltinModules` is used in
`Darwin::addClangTargetOptions`.

This ensures that the `import-std-module` API tests run cleanly
regardless of SDK version.

The plan is to eventually make the `CompilerInstance` construction in
`ClangExpressionParser` go through the driver, so we can avoid
duplicating the logic in LLDB. But we aren't there yet.

**Implementation**
* We look for the `SDKSettings.json` in the sysroot directory that we
found in DWARF (via `DW_AT_LLVM_sysroot`)
* Then parse this file and extract the SDK version number out of it
* Then mimick `sdkSupportsBuiltinModules` from `Toolchains/Darwin.cpp`
and set `BuiltinHeadersInSystemModules` based on it

rdar://116490281</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes the way we initialize `BuiltinHeadersInSystemModules`
which is one of the flags controlling Clang's behaviour when the Darwin
module is split into more fine-grained modules. The
ClangExpressionParser currently unconditionally sets
`-fbuiltin-headers-in-system-modules` when evaluating expressions with
the `target.import-std-module` setting. This flag should, however, be
set depending on the SDK version (which is what the Clang Darwin
toolchain does).

Unfortunately, the compiler instance that we create with
`ClangExpressionParser` never consults the Clang driver, and thus
doesn't correctly infer `BuiltinHeadersInSystemModules`. Note, this
isn't an issue with the `CompilerInstance` that the
`ClangModulesDeclVendor` creates because it uses the `createInovcation`
API, which calls into `Darwin::addClangTargetOptions`.

This patch mimicks how `sdkSupportsBuiltinModules` is used in
`Darwin::addClangTargetOptions`.

This ensures that the `import-std-module` API tests run cleanly
regardless of SDK version.

The plan is to eventually make the `CompilerInstance` construction in
`ClangExpressionParser` go through the driver, so we can avoid
duplicating the logic in LLDB. But we aren't there yet.

**Implementation**
* We look for the `SDKSettings.json` in the sysroot directory that we
found in DWARF (via `DW_AT_LLVM_sysroot`)
* Then parse this file and extract the SDK version number out of it
* Then mimick `sdkSupportsBuiltinModules` from `Toolchains/Darwin.cpp`
and set `BuiltinHeadersInSystemModules` based on it

rdar://116490281</pre>
</div>
</content>
</entry>
<entry>
<title>[lldb] Upstream xros support in lldb (#78389)</title>
<updated>2024-01-17T17:47:08+00:00</updated>
<author>
<name>Jonas Devlieghere</name>
<email>jonas@devlieghere.com</email>
</author>
<published>2024-01-17T17:47:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3b6a8f823bf873aa74cdb738f517e7333e20de7a'/>
<id>3b6a8f823bf873aa74cdb738f517e7333e20de7a</id>
<content type='text'>
Upstream support for debugging xros applications through LLDB.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Upstream support for debugging xros applications through LLDB.</pre>
</div>
</content>
</entry>
</feed>
