[Lldb-commits] [lldb] [lldb] Tweak check for CommandLineTools in ParseXcodeSDK (PR #154574)
Dave Lee via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 20 16:01:31 PDT 2025
https://github.com/kastiglione updated https://github.com/llvm/llvm-project/pull/154574
>From 13264919452f446dd13f5f8a3e3ed207e84bf96b Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Wed, 20 Aug 2025 09:41:26 -0700
Subject: [PATCH 1/2] [lldb] Tweak check for CommandLineTools in ParseXcodeSDK
---
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
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
>From aaa2193a8ab191147ba6f32195425b8d26257149 Mon Sep 17 00:00:00 2001
From: Dave Lee <davelee.com at gmail.com>
Date: Wed, 20 Aug 2025 16:00:59 -0700
Subject: [PATCH 2/2] remove unnecessary std::move
---
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 163cc19943683..b15e0c15fedb8 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1018,7 +1018,7 @@ XcodeSDK SymbolFileDWARF::ParseXcodeSDK(CompileUnit &comp_unit) {
local_module_sp->RegisterXcodeSDK(sdk, sysroot);
}
- return {sdk, FileSpec{std::move(sysroot)}};
+ return {sdk, FileSpec(sysroot)};
}
size_t SymbolFileDWARF::ParseFunctions(CompileUnit &comp_unit) {
More information about the lldb-commits
mailing list