[Lldb-commits] [lldb] [lldb] Tweak check for CommandLineTools in ParseXcodeSDK (PR #154574)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 20 09:53:03 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Dave Lee (kastiglione)
<details>
<summary>Changes</summary>
Follow up to https://github.com/llvm/llvm-project/pull/128712
---
Full diff: https://github.com/llvm/llvm-project/pull/154574.diff
1 Files Affected:
- (modified) lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (+3-2)
``````````diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 9958af26379b9..163cc19943683 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -8,6 +8,7 @@
#include "SymbolFileDWARF.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugLoc.h"
#include "llvm/Support/Casting.h"
@@ -998,12 +999,12 @@ XcodeSDK SymbolFileDWARF::ParseXcodeSDK(CompileUnit &comp_unit) {
const char *sdk = cu_die.GetAttributeValueAsString(DW_AT_APPLE_sdk, nullptr);
if (!sdk)
return {};
- std::string sysroot =
+ llvm::StringRef sysroot =
cu_die.GetAttributeValueAsString(DW_AT_LLVM_sysroot, "");
// RegisterXcodeSDK calls into xcrun which is not aware of CLT, which is
// expensive.
- if (sysroot.find("/Library/Developer/CommandLineTools/SDKs") != 0) {
+ if (!sysroot.starts_with("/Library/Developer/CommandLineTools/SDKs")) {
// Register the sysroot path remapping with the module belonging to
// the CU as well as the one belonging to the symbol file. The two
// would be different if this is an OSO object and module is the
``````````
</details>
https://github.com/llvm/llvm-project/pull/154574
More information about the lldb-commits
mailing list