Skip to content

Revert "LLVM symbolizer gsym support" #139660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025

Conversation

qinkunbao
Copy link
Member

Reverts #134847

@qinkunbao qinkunbao merged commit 52ed679 into main May 13, 2025
9 of 13 checks passed
@qinkunbao qinkunbao deleted the revert-134847-llvm_symbolizer_gsym_support branch May 13, 2025 02:43
@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-debuginfo

Author: Qinkun Bao (qinkunbao)

Changes

Reverts llvm/llvm-project#134847


Patch is 23.88 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139660.diff

13 Files Affected:

  • (modified) llvm/include/llvm/DebugInfo/DIContext.h (+1-1)
  • (removed) llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h (-66)
  • (modified) llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h (-3)
  • (modified) llvm/lib/DebugInfo/GSYM/CMakeLists.txt (-1)
  • (removed) llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp (-166)
  • (modified) llvm/lib/DebugInfo/Symbolize/CMakeLists.txt (-1)
  • (modified) llvm/lib/DebugInfo/Symbolize/Symbolize.cpp (+23-71)
  • (removed) llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe ()
  • (removed) llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym ()
  • (removed) llvm/test/tools/llvm-symbolizer/sym-gsymonly.test (-93)
  • (modified) llvm/tools/llvm-symbolizer/Opts.td (-5)
  • (modified) llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp (-2)
  • (modified) llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn (-1)
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h
index 0347f90c236d1..c90b99987f1db 100644
--- a/llvm/include/llvm/DebugInfo/DIContext.h
+++ b/llvm/include/llvm/DebugInfo/DIContext.h
@@ -238,7 +238,7 @@ struct DIDumpOptions {
 
 class DIContext {
 public:
-  enum DIContextKind { CK_DWARF, CK_PDB, CK_BTF, CK_GSYM };
+  enum DIContextKind { CK_DWARF, CK_PDB, CK_BTF };
 
   DIContext(DIContextKind K) : Kind(K) {}
   virtual ~DIContext() = default;
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h b/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
deleted file mode 100644
index 396c08c608d25..0000000000000
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//===-- GsymDIContext.h --------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===/
-
-#ifndef LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
-#define LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
-
-#include "llvm/DebugInfo/DIContext.h"
-#include <cstdint>
-#include <memory>
-#include <string>
-
-namespace llvm {
-
-namespace gsym {
-
-class GsymReader;
-
-/// GSYM DI Context
-/// This data structure is the top level entity that deals with GSYM
-/// symbolication.
-/// This data structure exists only when there is a need for a transparent
-/// interface to different symbolication formats (e.g. GSYM, PDB and DWARF).
-/// More control and power over the debug information access can be had by using
-/// the GSYM interfaces directly.
-class GsymDIContext : public DIContext {
-public:
-  GsymDIContext(std::unique_ptr<GsymReader> Reader);
-
-  GsymDIContext(GsymDIContext &) = delete;
-  GsymDIContext &operator=(GsymDIContext &) = delete;
-
-  static bool classof(const DIContext *DICtx) {
-    return DICtx->getKind() == CK_GSYM;
-  }
-
-  void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override;
-
-  std::optional<DILineInfo> getLineInfoForAddress(
-      object::SectionedAddress Address,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-  std::optional<DILineInfo>
-  getLineInfoForDataAddress(object::SectionedAddress Address) override;
-  DILineInfoTable getLineInfoForAddressRange(
-      object::SectionedAddress Address, uint64_t Size,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-  DIInliningInfo getInliningInfoForAddress(
-      object::SectionedAddress Address,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-
-  std::vector<DILocal>
-  getLocalsForAddress(object::SectionedAddress Address) override;
-
-private:
-  const std::unique_ptr<GsymReader> Reader;
-};
-
-} // end namespace gsym
-
-} // end namespace llvm
-
-#endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
index 7c6beaa2189b7..5747ad99d0f13 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -58,13 +58,11 @@ class LLVMSymbolizer {
     bool RelativeAddresses = false;
     bool UntagAddresses = false;
     bool UseDIA = false;
-    bool DisableGsym = false;
     std::string DefaultArch;
     std::vector<std::string> DsymHints;
     std::string FallbackDebugPath;
     std::string DWPName;
     std::vector<std::string> DebugFileDirectory;
-    std::vector<std::string> GsymFileDirectory;
     size_t MaxCacheSize =
         sizeof(size_t) == 4
             ? 512 * 1024 * 1024 /* 512 MiB */
@@ -179,7 +177,6 @@ class LLVMSymbolizer {
   ObjectFile *lookUpBuildIDObject(const std::string &Path,
                                   const ELFObjectFileBase *Obj,
                                   const std::string &ArchName);
-  std::string lookUpGsymFile(const std::string &Path);
 
   bool findDebugBinary(const std::string &OrigPath,
                        const std::string &DebuglinkName, uint32_t CRCHash,
diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index 724b5b213d643..c27d648db62f6 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -4,7 +4,6 @@ add_llvm_component_library(LLVMDebugInfoGSYM
   FileWriter.cpp
   FunctionInfo.cpp
   GsymCreator.cpp
-  GsymDIContext.cpp
   GsymReader.cpp
   InlineInfo.cpp
   LineTable.cpp
diff --git a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp b/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
deleted file mode 100644
index 68024a9c9e782..0000000000000
--- a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===-- GsymDIContext.cpp ------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===/
-
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
-
-#include "llvm/DebugInfo/GSYM/GsymReader.h"
-#include "llvm/Support/Path.h"
-
-using namespace llvm;
-using namespace llvm::gsym;
-
-GsymDIContext::GsymDIContext(std::unique_ptr<GsymReader> Reader)
-    : DIContext(CK_GSYM), Reader(std::move(Reader)) {}
-
-void GsymDIContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}
-
-static bool fillLineInfoFromLocation(const SourceLocation &Location,
-                                     DILineInfoSpecifier Specifier,
-                                     DILineInfo &LineInfo) {
-  // FIXME Demangle in case of DINameKind::ShortName
-  if (Specifier.FNKind != DINameKind::None) {
-    LineInfo.FunctionName = Location.Name.str();
-  }
-
-  switch (Specifier.FLIKind) {
-  case DILineInfoSpecifier::FileLineInfoKind::RelativeFilePath:
-    // We have no information to determine the relative path, so we fall back to
-    // returning the absolute path.
-  case DILineInfoSpecifier::FileLineInfoKind::RawValue:
-  case DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath:
-    if (Location.Dir.empty()) {
-      if (Location.Base.empty())
-        LineInfo.FileName = DILineInfo::BadString;
-      else
-        LineInfo.FileName = Location.Base.str();
-    } else {
-      SmallString<128> Path(Location.Dir);
-      sys::path::append(Path, Location.Base);
-      LineInfo.FileName = static_cast<std::string>(Path);
-    }
-    break;
-
-  case DILineInfoSpecifier::FileLineInfoKind::BaseNameOnly:
-    LineInfo.FileName = Location.Base.str();
-    break;
-
-  default:
-    return false;
-  }
-  LineInfo.Line = Location.Line;
-
-  // We don't have information in GSYM to fill any of the Source, Column,
-  // StartFileName or StartLine attributes.
-
-  return true;
-}
-
-std::optional<DILineInfo>
-GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
-                                     DILineInfoSpecifier Specifier) {
-  if (Address.SectionIndex != object::SectionedAddress::UndefSection)
-    return {};
-
-  auto ResultOrErr = Reader->lookup(Address.Address);
-
-  if (!ResultOrErr) {
-    consumeError(ResultOrErr.takeError());
-    return {};
-  }
-
-  const auto &Result = *ResultOrErr;
-
-  DILineInfo LineInfo;
-
-  if (Result.Locations.empty()) {
-    // No debug info for this, we just had a symbol from the symbol table.
-
-    // FIXME Demangle in case of DINameKind::ShortName
-    if (Specifier.FNKind != DINameKind::None)
-      LineInfo.FunctionName = Result.FuncName.str();
-  } else if (!fillLineInfoFromLocation(Result.Locations.front(), Specifier,
-                                       LineInfo))
-    return {};
-
-  LineInfo.StartAddress = Result.FuncRange.start();
-
-  return LineInfo;
-}
-
-std::optional<DILineInfo>
-GsymDIContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
-  // We can't implement this, there's no such information in the GSYM file.
-
-  return {};
-}
-
-DILineInfoTable
-GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
-                                          uint64_t Size,
-                                          DILineInfoSpecifier Specifier) {
-  if (Size == 0)
-    return DILineInfoTable();
-
-  if (Address.SectionIndex != llvm::object::SectionedAddress::UndefSection)
-    return DILineInfoTable();
-
-  if (auto FuncInfoOrErr = Reader->getFunctionInfo(Address.Address)) {
-    DILineInfoTable Table;
-    if (FuncInfoOrErr->OptLineTable) {
-      const gsym::LineTable &LT = *FuncInfoOrErr->OptLineTable;
-      const uint64_t StartAddr = Address.Address;
-      const uint64_t EndAddr = Address.Address + Size;
-      for (const auto &LineEntry : LT) {
-        if (StartAddr <= LineEntry.Addr && LineEntry.Addr < EndAddr) {
-          // Use LineEntry.Addr, LineEntry.File (which is a file index into the
-          // files tables from the GsymReader), and LineEntry.Line (source line
-          // number) to add stuff to the DILineInfoTable
-        }
-      }
-    }
-    return Table;
-  } else {
-    consumeError(FuncInfoOrErr.takeError());
-    return DILineInfoTable();
-  }
-}
-
-DIInliningInfo
-GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
-                                         DILineInfoSpecifier Specifier) {
-  auto ResultOrErr = Reader->lookup(Address.Address);
-
-  if (!ResultOrErr)
-    return {};
-
-  const auto &Result = *ResultOrErr;
-
-  DIInliningInfo InlineInfo;
-
-  for (const auto &Location : Result.Locations) {
-    DILineInfo LineInfo;
-
-    if (!fillLineInfoFromLocation(Location, Specifier, LineInfo))
-      return {};
-
-    // Hm, that's probably something that should only be filled in the first or
-    // last frame?
-    LineInfo.StartAddress = Result.FuncRange.start();
-
-    InlineInfo.addFrame(LineInfo);
-  }
-
-  return InlineInfo;
-}
-
-std::vector<DILocal>
-GsymDIContext::getLocalsForAddress(object::SectionedAddress Address) {
-  // We can't implement this, there's no such information in the GSYM file.
-
-  return {};
-}
diff --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
index 7aef3b0d79a3a..29f62bf6156fc 100644
--- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
@@ -10,7 +10,6 @@ add_llvm_component_library(LLVMSymbolize
 
   LINK_COMPONENTS
   DebugInfoDWARF
-  DebugInfoGSYM
   DebugInfoPDB
   DebugInfoBTF
   Object
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 78a1421005de2..1d8217ad587ec 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -15,8 +15,6 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/DebugInfo/BTF/BTFContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
-#include "llvm/DebugInfo/GSYM/GsymReader.h"
 #include "llvm/DebugInfo/PDB/PDB.h"
 #include "llvm/DebugInfo/PDB/PDBContext.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h"
@@ -500,34 +498,6 @@ bool LLVMSymbolizer::getOrFindDebugBinary(const ArrayRef<uint8_t> BuildID,
   return false;
 }
 
-std::string LLVMSymbolizer::lookUpGsymFile(const std::string &Path) {
-  if (Opts.DisableGsym)
-    return {};
-
-  auto CheckGsymFile = [](const llvm::StringRef &GsymPath) {
-    sys::fs::file_status Status;
-    std::error_code EC = llvm::sys::fs::status(GsymPath, Status);
-    return !EC && !llvm::sys::fs::is_directory(Status);
-  };
-
-  // First, look beside the binary file
-  if (const auto GsymPath = Path + ".gsym"; CheckGsymFile(GsymPath))
-    return GsymPath;
-
-  // Then, look in the directories specified by GsymFileDirectory
-
-  for (const auto &Directory : Opts.GsymFileDirectory) {
-    SmallString<16> GsymPath = llvm::StringRef{Directory};
-    llvm::sys::path::append(GsymPath,
-                            llvm::sys::path::filename(Path) + ".gsym");
-
-    if (CheckGsymFile(GsymPath))
-      return static_cast<std::string>(GsymPath);
-  }
-
-  return {};
-}
-
 Expected<LLVMSymbolizer::ObjectPair>
 LLVMSymbolizer::getOrCreateObjectPair(const std::string &Path,
                                       const std::string &ArchName) {
@@ -664,48 +634,30 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
   std::unique_ptr<DIContext> Context;
   // If this is a COFF object containing PDB info and not containing DWARF
   // section, use a PDBContext to symbolize. Otherwise, use DWARF.
-  // Create a DIContext to symbolize as follows:
-  // - If there is a GSYM file, create a GsymDIContext.
-  // - Otherwise, if this is a COFF object containing PDB info, create a
-  // PDBContext.
-  // - Otherwise, create a DWARFContext.
-  const auto GsymFile = lookUpGsymFile(BinaryName.str());
-  if (!GsymFile.empty()) {
-    auto ReaderOrErr = gsym::GsymReader::openFile(GsymFile);
-
-    if (ReaderOrErr) {
-      std::unique_ptr<gsym::GsymReader> Reader =
-          std::make_unique<gsym::GsymReader>(std::move(*ReaderOrErr));
-
-      Context = std::make_unique<gsym::GsymDIContext>(std::move(Reader));
-    }
-  }
-  if (!Context) {
-    if (auto CoffObject = dyn_cast<COFFObjectFile>(Objects.first)) {
-      const codeview::DebugInfo *DebugInfo;
-      StringRef PDBFileName;
-      auto EC = CoffObject->getDebugPDBInfo(DebugInfo, PDBFileName);
-      // Use DWARF if there're DWARF sections.
-      bool HasDwarf = llvm::any_of(
-          Objects.first->sections(), [](SectionRef Section) -> bool {
-            if (Expected<StringRef> SectionName = Section.getName())
-              return SectionName.get() == ".debug_info";
-            return false;
-          });
-      if (!EC && !HasDwarf && DebugInfo != nullptr && !PDBFileName.empty()) {
-        using namespace pdb;
-        std::unique_ptr<IPDBSession> Session;
-
-        PDB_ReaderType ReaderType =
-            Opts.UseDIA ? PDB_ReaderType::DIA : PDB_ReaderType::Native;
-        if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
-                                      Session)) {
-          Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());
-          // Return along the PDB filename to provide more context
-          return createFileError(PDBFileName, std::move(Err));
-        }
-        Context.reset(new PDBContext(*CoffObject, std::move(Session)));
+  if (auto CoffObject = dyn_cast<COFFObjectFile>(Objects.first)) {
+    const codeview::DebugInfo *DebugInfo;
+    StringRef PDBFileName;
+    auto EC = CoffObject->getDebugPDBInfo(DebugInfo, PDBFileName);
+    // Use DWARF if there're DWARF sections.
+    bool HasDwarf =
+        llvm::any_of(Objects.first->sections(), [](SectionRef Section) -> bool {
+          if (Expected<StringRef> SectionName = Section.getName())
+            return SectionName.get() == ".debug_info";
+          return false;
+        });
+    if (!EC && !HasDwarf && DebugInfo != nullptr && !PDBFileName.empty()) {
+      using namespace pdb;
+      std::unique_ptr<IPDBSession> Session;
+
+      PDB_ReaderType ReaderType =
+          Opts.UseDIA ? PDB_ReaderType::DIA : PDB_ReaderType::Native;
+      if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
+                                    Session)) {
+        Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());
+        // Return along the PDB filename to provide more context
+        return createFileError(PDBFileName, std::move(Err));
       }
+      Context.reset(new PDBContext(*CoffObject, std::move(Session)));
     }
   }
   if (!Context)
diff --git a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe b/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe
deleted file mode 100755
index f6f013b245822..0000000000000
Binary files a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe and /dev/null differ
diff --git a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym b/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym
deleted file mode 100644
index a46f78b9d880c..0000000000000
Binary files a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym and /dev/null differ
diff --git a/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test b/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test
deleted file mode 100644
index 0d00c002a2bdb..0000000000000
--- a/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test
+++ /dev/null
@@ -1,93 +0,0 @@
-# This test is a variant of sym.test. It uses a binary without DWARF debug
-# info, but a corresponding .gsym file. The expectations are the same, except
-# for the fact that GSYM doesn't provide us with column numbers.
-#
-# Source:
-# #include <stdio.h>
-# static inline int inctwo (int *a) {
-#   printf ("%d\n",(*a)++);
-#   return (*a)++;
-# }
-# static inline int inc (int *a) {
-#   printf ("%d\n",inctwo(a));
-#   return (*a)++;
-# }
-#
-#
-# int main () {
-#   int x = 1;
-#   return inc(&x);
-# }
-#
-# Build as : clang -g -O2 addr.c
-extrat gsym file as : llvm-gsymutil --convert=%p/Inputs/addr.exe --out-file=%p/Inputs/addr-gsymonly.exe.gsym
-strip debug as : llvm-objcopy --strip-debug %p/Inputs/addr.exe %p/Inputs/addr-gsymonly.exe
-
-
-RUN: llvm-symbolizer --print-address --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-RUN: llvm-symbolizer --addresses --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-RUN: llvm-symbolizer -a --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-
-CHECK: ??:0:0
-CHECK-EMPTY:
-CHECK-NEXT: 0x40054d
-CHECK-NEXT: inctwo
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:3:0
-CHECK-NEXT: inc
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:7:0
-CHECK-NEXT: main
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:14:0
-CHECK-EMPTY:
-CHECK-NEXT: ??
-CHECK-NEXT: ??:0:0
-
-RUN: llvm-symbolizer --inlining --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 
-RUN: llvm-symbolizer --inlining --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer --inlines --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer --inlines --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer -i --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer -i --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-
-# Before 2020-08-04, asan_symbolize.py passed --inlining=true.
-# Support this compatibility alias for a while.
-RUN: llvm-symbolizer --inlining=true --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-
-PRETTY: ??:0:0
-PRETTY: {{[0x]+}}40054d: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3:0
-PRETTY:  (inlined by) inc at {{[/\]+}}tmp{{[/\]+}}x.c:7:0
-PRETTY:  (inlined by) main at {{[/\]+}}tmp{{[/\]+}}x.c:14:0
-PRETTY: ??:0:0
-
-RUN: llvm-addr2line --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix=A2L %s
-RUN: llvm-addr2line -a --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_A %s
-RUN: llvm-addr2line -f --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F %s
-RUN: llvm-addr2line -i --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_I %s
-RUN: llvm-addr2line -fi --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F,A2L_I,A2L_FI %s
-
-RUN: llvm-addr2line -pa --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_A %s
-RUN: llvm-addr2line -pf --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_F %s
-RUN: llvm-addr2line -paf --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_AF %s
-RUN: llvm-addr2line -pai --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2...
[truncated]

@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-llvm-binary-utilities

Author: Qinkun Bao (qinkunbao)

Changes

Reverts llvm/llvm-project#134847


Patch is 23.88 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/139660.diff

13 Files Affected:

  • (modified) llvm/include/llvm/DebugInfo/DIContext.h (+1-1)
  • (removed) llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h (-66)
  • (modified) llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h (-3)
  • (modified) llvm/lib/DebugInfo/GSYM/CMakeLists.txt (-1)
  • (removed) llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp (-166)
  • (modified) llvm/lib/DebugInfo/Symbolize/CMakeLists.txt (-1)
  • (modified) llvm/lib/DebugInfo/Symbolize/Symbolize.cpp (+23-71)
  • (removed) llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe ()
  • (removed) llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym ()
  • (removed) llvm/test/tools/llvm-symbolizer/sym-gsymonly.test (-93)
  • (modified) llvm/tools/llvm-symbolizer/Opts.td (-5)
  • (modified) llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp (-2)
  • (modified) llvm/utils/gn/secondary/llvm/lib/DebugInfo/GSYM/BUILD.gn (-1)
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h
index 0347f90c236d1..c90b99987f1db 100644
--- a/llvm/include/llvm/DebugInfo/DIContext.h
+++ b/llvm/include/llvm/DebugInfo/DIContext.h
@@ -238,7 +238,7 @@ struct DIDumpOptions {
 
 class DIContext {
 public:
-  enum DIContextKind { CK_DWARF, CK_PDB, CK_BTF, CK_GSYM };
+  enum DIContextKind { CK_DWARF, CK_PDB, CK_BTF };
 
   DIContext(DIContextKind K) : Kind(K) {}
   virtual ~DIContext() = default;
diff --git a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h b/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
deleted file mode 100644
index 396c08c608d25..0000000000000
--- a/llvm/include/llvm/DebugInfo/GSYM/GsymDIContext.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//===-- GsymDIContext.h --------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===/
-
-#ifndef LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
-#define LLVM_DEBUGINFO_GSYM_GSYMDICONTEXT_H
-
-#include "llvm/DebugInfo/DIContext.h"
-#include <cstdint>
-#include <memory>
-#include <string>
-
-namespace llvm {
-
-namespace gsym {
-
-class GsymReader;
-
-/// GSYM DI Context
-/// This data structure is the top level entity that deals with GSYM
-/// symbolication.
-/// This data structure exists only when there is a need for a transparent
-/// interface to different symbolication formats (e.g. GSYM, PDB and DWARF).
-/// More control and power over the debug information access can be had by using
-/// the GSYM interfaces directly.
-class GsymDIContext : public DIContext {
-public:
-  GsymDIContext(std::unique_ptr<GsymReader> Reader);
-
-  GsymDIContext(GsymDIContext &) = delete;
-  GsymDIContext &operator=(GsymDIContext &) = delete;
-
-  static bool classof(const DIContext *DICtx) {
-    return DICtx->getKind() == CK_GSYM;
-  }
-
-  void dump(raw_ostream &OS, DIDumpOptions DIDumpOpts) override;
-
-  std::optional<DILineInfo> getLineInfoForAddress(
-      object::SectionedAddress Address,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-  std::optional<DILineInfo>
-  getLineInfoForDataAddress(object::SectionedAddress Address) override;
-  DILineInfoTable getLineInfoForAddressRange(
-      object::SectionedAddress Address, uint64_t Size,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-  DIInliningInfo getInliningInfoForAddress(
-      object::SectionedAddress Address,
-      DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
-
-  std::vector<DILocal>
-  getLocalsForAddress(object::SectionedAddress Address) override;
-
-private:
-  const std::unique_ptr<GsymReader> Reader;
-};
-
-} // end namespace gsym
-
-} // end namespace llvm
-
-#endif // LLVM_DEBUGINFO_PDB_PDBCONTEXT_H
diff --git a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
index 7c6beaa2189b7..5747ad99d0f13 100644
--- a/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
+++ b/llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h
@@ -58,13 +58,11 @@ class LLVMSymbolizer {
     bool RelativeAddresses = false;
     bool UntagAddresses = false;
     bool UseDIA = false;
-    bool DisableGsym = false;
     std::string DefaultArch;
     std::vector<std::string> DsymHints;
     std::string FallbackDebugPath;
     std::string DWPName;
     std::vector<std::string> DebugFileDirectory;
-    std::vector<std::string> GsymFileDirectory;
     size_t MaxCacheSize =
         sizeof(size_t) == 4
             ? 512 * 1024 * 1024 /* 512 MiB */
@@ -179,7 +177,6 @@ class LLVMSymbolizer {
   ObjectFile *lookUpBuildIDObject(const std::string &Path,
                                   const ELFObjectFileBase *Obj,
                                   const std::string &ArchName);
-  std::string lookUpGsymFile(const std::string &Path);
 
   bool findDebugBinary(const std::string &OrigPath,
                        const std::string &DebuglinkName, uint32_t CRCHash,
diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index 724b5b213d643..c27d648db62f6 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -4,7 +4,6 @@ add_llvm_component_library(LLVMDebugInfoGSYM
   FileWriter.cpp
   FunctionInfo.cpp
   GsymCreator.cpp
-  GsymDIContext.cpp
   GsymReader.cpp
   InlineInfo.cpp
   LineTable.cpp
diff --git a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp b/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
deleted file mode 100644
index 68024a9c9e782..0000000000000
--- a/llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-//===-- GsymDIContext.cpp ------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===/
-
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
-
-#include "llvm/DebugInfo/GSYM/GsymReader.h"
-#include "llvm/Support/Path.h"
-
-using namespace llvm;
-using namespace llvm::gsym;
-
-GsymDIContext::GsymDIContext(std::unique_ptr<GsymReader> Reader)
-    : DIContext(CK_GSYM), Reader(std::move(Reader)) {}
-
-void GsymDIContext::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {}
-
-static bool fillLineInfoFromLocation(const SourceLocation &Location,
-                                     DILineInfoSpecifier Specifier,
-                                     DILineInfo &LineInfo) {
-  // FIXME Demangle in case of DINameKind::ShortName
-  if (Specifier.FNKind != DINameKind::None) {
-    LineInfo.FunctionName = Location.Name.str();
-  }
-
-  switch (Specifier.FLIKind) {
-  case DILineInfoSpecifier::FileLineInfoKind::RelativeFilePath:
-    // We have no information to determine the relative path, so we fall back to
-    // returning the absolute path.
-  case DILineInfoSpecifier::FileLineInfoKind::RawValue:
-  case DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath:
-    if (Location.Dir.empty()) {
-      if (Location.Base.empty())
-        LineInfo.FileName = DILineInfo::BadString;
-      else
-        LineInfo.FileName = Location.Base.str();
-    } else {
-      SmallString<128> Path(Location.Dir);
-      sys::path::append(Path, Location.Base);
-      LineInfo.FileName = static_cast<std::string>(Path);
-    }
-    break;
-
-  case DILineInfoSpecifier::FileLineInfoKind::BaseNameOnly:
-    LineInfo.FileName = Location.Base.str();
-    break;
-
-  default:
-    return false;
-  }
-  LineInfo.Line = Location.Line;
-
-  // We don't have information in GSYM to fill any of the Source, Column,
-  // StartFileName or StartLine attributes.
-
-  return true;
-}
-
-std::optional<DILineInfo>
-GsymDIContext::getLineInfoForAddress(object::SectionedAddress Address,
-                                     DILineInfoSpecifier Specifier) {
-  if (Address.SectionIndex != object::SectionedAddress::UndefSection)
-    return {};
-
-  auto ResultOrErr = Reader->lookup(Address.Address);
-
-  if (!ResultOrErr) {
-    consumeError(ResultOrErr.takeError());
-    return {};
-  }
-
-  const auto &Result = *ResultOrErr;
-
-  DILineInfo LineInfo;
-
-  if (Result.Locations.empty()) {
-    // No debug info for this, we just had a symbol from the symbol table.
-
-    // FIXME Demangle in case of DINameKind::ShortName
-    if (Specifier.FNKind != DINameKind::None)
-      LineInfo.FunctionName = Result.FuncName.str();
-  } else if (!fillLineInfoFromLocation(Result.Locations.front(), Specifier,
-                                       LineInfo))
-    return {};
-
-  LineInfo.StartAddress = Result.FuncRange.start();
-
-  return LineInfo;
-}
-
-std::optional<DILineInfo>
-GsymDIContext::getLineInfoForDataAddress(object::SectionedAddress Address) {
-  // We can't implement this, there's no such information in the GSYM file.
-
-  return {};
-}
-
-DILineInfoTable
-GsymDIContext::getLineInfoForAddressRange(object::SectionedAddress Address,
-                                          uint64_t Size,
-                                          DILineInfoSpecifier Specifier) {
-  if (Size == 0)
-    return DILineInfoTable();
-
-  if (Address.SectionIndex != llvm::object::SectionedAddress::UndefSection)
-    return DILineInfoTable();
-
-  if (auto FuncInfoOrErr = Reader->getFunctionInfo(Address.Address)) {
-    DILineInfoTable Table;
-    if (FuncInfoOrErr->OptLineTable) {
-      const gsym::LineTable &LT = *FuncInfoOrErr->OptLineTable;
-      const uint64_t StartAddr = Address.Address;
-      const uint64_t EndAddr = Address.Address + Size;
-      for (const auto &LineEntry : LT) {
-        if (StartAddr <= LineEntry.Addr && LineEntry.Addr < EndAddr) {
-          // Use LineEntry.Addr, LineEntry.File (which is a file index into the
-          // files tables from the GsymReader), and LineEntry.Line (source line
-          // number) to add stuff to the DILineInfoTable
-        }
-      }
-    }
-    return Table;
-  } else {
-    consumeError(FuncInfoOrErr.takeError());
-    return DILineInfoTable();
-  }
-}
-
-DIInliningInfo
-GsymDIContext::getInliningInfoForAddress(object::SectionedAddress Address,
-                                         DILineInfoSpecifier Specifier) {
-  auto ResultOrErr = Reader->lookup(Address.Address);
-
-  if (!ResultOrErr)
-    return {};
-
-  const auto &Result = *ResultOrErr;
-
-  DIInliningInfo InlineInfo;
-
-  for (const auto &Location : Result.Locations) {
-    DILineInfo LineInfo;
-
-    if (!fillLineInfoFromLocation(Location, Specifier, LineInfo))
-      return {};
-
-    // Hm, that's probably something that should only be filled in the first or
-    // last frame?
-    LineInfo.StartAddress = Result.FuncRange.start();
-
-    InlineInfo.addFrame(LineInfo);
-  }
-
-  return InlineInfo;
-}
-
-std::vector<DILocal>
-GsymDIContext::getLocalsForAddress(object::SectionedAddress Address) {
-  // We can't implement this, there's no such information in the GSYM file.
-
-  return {};
-}
diff --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
index 7aef3b0d79a3a..29f62bf6156fc 100644
--- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt
@@ -10,7 +10,6 @@ add_llvm_component_library(LLVMSymbolize
 
   LINK_COMPONENTS
   DebugInfoDWARF
-  DebugInfoGSYM
   DebugInfoPDB
   DebugInfoBTF
   Object
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 78a1421005de2..1d8217ad587ec 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -15,8 +15,6 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/DebugInfo/BTF/BTFContext.h"
 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
-#include "llvm/DebugInfo/GSYM/GsymDIContext.h"
-#include "llvm/DebugInfo/GSYM/GsymReader.h"
 #include "llvm/DebugInfo/PDB/PDB.h"
 #include "llvm/DebugInfo/PDB/PDBContext.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h"
@@ -500,34 +498,6 @@ bool LLVMSymbolizer::getOrFindDebugBinary(const ArrayRef<uint8_t> BuildID,
   return false;
 }
 
-std::string LLVMSymbolizer::lookUpGsymFile(const std::string &Path) {
-  if (Opts.DisableGsym)
-    return {};
-
-  auto CheckGsymFile = [](const llvm::StringRef &GsymPath) {
-    sys::fs::file_status Status;
-    std::error_code EC = llvm::sys::fs::status(GsymPath, Status);
-    return !EC && !llvm::sys::fs::is_directory(Status);
-  };
-
-  // First, look beside the binary file
-  if (const auto GsymPath = Path + ".gsym"; CheckGsymFile(GsymPath))
-    return GsymPath;
-
-  // Then, look in the directories specified by GsymFileDirectory
-
-  for (const auto &Directory : Opts.GsymFileDirectory) {
-    SmallString<16> GsymPath = llvm::StringRef{Directory};
-    llvm::sys::path::append(GsymPath,
-                            llvm::sys::path::filename(Path) + ".gsym");
-
-    if (CheckGsymFile(GsymPath))
-      return static_cast<std::string>(GsymPath);
-  }
-
-  return {};
-}
-
 Expected<LLVMSymbolizer::ObjectPair>
 LLVMSymbolizer::getOrCreateObjectPair(const std::string &Path,
                                       const std::string &ArchName) {
@@ -664,48 +634,30 @@ LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
   std::unique_ptr<DIContext> Context;
   // If this is a COFF object containing PDB info and not containing DWARF
   // section, use a PDBContext to symbolize. Otherwise, use DWARF.
-  // Create a DIContext to symbolize as follows:
-  // - If there is a GSYM file, create a GsymDIContext.
-  // - Otherwise, if this is a COFF object containing PDB info, create a
-  // PDBContext.
-  // - Otherwise, create a DWARFContext.
-  const auto GsymFile = lookUpGsymFile(BinaryName.str());
-  if (!GsymFile.empty()) {
-    auto ReaderOrErr = gsym::GsymReader::openFile(GsymFile);
-
-    if (ReaderOrErr) {
-      std::unique_ptr<gsym::GsymReader> Reader =
-          std::make_unique<gsym::GsymReader>(std::move(*ReaderOrErr));
-
-      Context = std::make_unique<gsym::GsymDIContext>(std::move(Reader));
-    }
-  }
-  if (!Context) {
-    if (auto CoffObject = dyn_cast<COFFObjectFile>(Objects.first)) {
-      const codeview::DebugInfo *DebugInfo;
-      StringRef PDBFileName;
-      auto EC = CoffObject->getDebugPDBInfo(DebugInfo, PDBFileName);
-      // Use DWARF if there're DWARF sections.
-      bool HasDwarf = llvm::any_of(
-          Objects.first->sections(), [](SectionRef Section) -> bool {
-            if (Expected<StringRef> SectionName = Section.getName())
-              return SectionName.get() == ".debug_info";
-            return false;
-          });
-      if (!EC && !HasDwarf && DebugInfo != nullptr && !PDBFileName.empty()) {
-        using namespace pdb;
-        std::unique_ptr<IPDBSession> Session;
-
-        PDB_ReaderType ReaderType =
-            Opts.UseDIA ? PDB_ReaderType::DIA : PDB_ReaderType::Native;
-        if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
-                                      Session)) {
-          Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());
-          // Return along the PDB filename to provide more context
-          return createFileError(PDBFileName, std::move(Err));
-        }
-        Context.reset(new PDBContext(*CoffObject, std::move(Session)));
+  if (auto CoffObject = dyn_cast<COFFObjectFile>(Objects.first)) {
+    const codeview::DebugInfo *DebugInfo;
+    StringRef PDBFileName;
+    auto EC = CoffObject->getDebugPDBInfo(DebugInfo, PDBFileName);
+    // Use DWARF if there're DWARF sections.
+    bool HasDwarf =
+        llvm::any_of(Objects.first->sections(), [](SectionRef Section) -> bool {
+          if (Expected<StringRef> SectionName = Section.getName())
+            return SectionName.get() == ".debug_info";
+          return false;
+        });
+    if (!EC && !HasDwarf && DebugInfo != nullptr && !PDBFileName.empty()) {
+      using namespace pdb;
+      std::unique_ptr<IPDBSession> Session;
+
+      PDB_ReaderType ReaderType =
+          Opts.UseDIA ? PDB_ReaderType::DIA : PDB_ReaderType::Native;
+      if (auto Err = loadDataForEXE(ReaderType, Objects.first->getFileName(),
+                                    Session)) {
+        Modules.emplace(ModuleName, std::unique_ptr<SymbolizableModule>());
+        // Return along the PDB filename to provide more context
+        return createFileError(PDBFileName, std::move(Err));
       }
+      Context.reset(new PDBContext(*CoffObject, std::move(Session)));
     }
   }
   if (!Context)
diff --git a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe b/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe
deleted file mode 100755
index f6f013b245822..0000000000000
Binary files a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe and /dev/null differ
diff --git a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym b/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym
deleted file mode 100644
index a46f78b9d880c..0000000000000
Binary files a/llvm/test/tools/llvm-symbolizer/Inputs/addr-gsymonly.exe.gsym and /dev/null differ
diff --git a/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test b/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test
deleted file mode 100644
index 0d00c002a2bdb..0000000000000
--- a/llvm/test/tools/llvm-symbolizer/sym-gsymonly.test
+++ /dev/null
@@ -1,93 +0,0 @@
-# This test is a variant of sym.test. It uses a binary without DWARF debug
-# info, but a corresponding .gsym file. The expectations are the same, except
-# for the fact that GSYM doesn't provide us with column numbers.
-#
-# Source:
-# #include <stdio.h>
-# static inline int inctwo (int *a) {
-#   printf ("%d\n",(*a)++);
-#   return (*a)++;
-# }
-# static inline int inc (int *a) {
-#   printf ("%d\n",inctwo(a));
-#   return (*a)++;
-# }
-#
-#
-# int main () {
-#   int x = 1;
-#   return inc(&x);
-# }
-#
-# Build as : clang -g -O2 addr.c
-extrat gsym file as : llvm-gsymutil --convert=%p/Inputs/addr.exe --out-file=%p/Inputs/addr-gsymonly.exe.gsym
-strip debug as : llvm-objcopy --strip-debug %p/Inputs/addr.exe %p/Inputs/addr-gsymonly.exe
-
-
-RUN: llvm-symbolizer --print-address --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-RUN: llvm-symbolizer --addresses --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-RUN: llvm-symbolizer -a --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck %s
-
-CHECK: ??:0:0
-CHECK-EMPTY:
-CHECK-NEXT: 0x40054d
-CHECK-NEXT: inctwo
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:3:0
-CHECK-NEXT: inc
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:7:0
-CHECK-NEXT: main
-CHECK-NEXT: {{[/\]+}}tmp{{[/\]+}}x.c:14:0
-CHECK-EMPTY:
-CHECK-NEXT: ??
-CHECK-NEXT: ??:0:0
-
-RUN: llvm-symbolizer --inlining --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s 
-RUN: llvm-symbolizer --inlining --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer --inlines --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer --inlines --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer -i --print-address --pretty-print --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-RUN: llvm-symbolizer -i --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-
-# Before 2020-08-04, asan_symbolize.py passed --inlining=true.
-# Support this compatibility alias for a while.
-RUN: llvm-symbolizer --inlining=true --print-address -p --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix="PRETTY" %s
-
-PRETTY: ??:0:0
-PRETTY: {{[0x]+}}40054d: inctwo at {{[/\]+}}tmp{{[/\]+}}x.c:3:0
-PRETTY:  (inlined by) inc at {{[/\]+}}tmp{{[/\]+}}x.c:7:0
-PRETTY:  (inlined by) main at {{[/\]+}}tmp{{[/\]+}}x.c:14:0
-PRETTY: ??:0:0
-
-RUN: llvm-addr2line --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefix=A2L %s
-RUN: llvm-addr2line -a --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_A %s
-RUN: llvm-addr2line -f --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F %s
-RUN: llvm-addr2line -i --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_I %s
-RUN: llvm-addr2line -fi --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2L,A2L_F,A2L_I,A2L_FI %s
-
-RUN: llvm-addr2line -pa --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_A %s
-RUN: llvm-addr2line -pf --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_F %s
-RUN: llvm-addr2line -paf --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2LP,A2LP_AF %s
-RUN: llvm-addr2line -pai --obj=%p/Inputs/addr-gsymonly.exe < %p/Inputs/addr.inp | FileCheck -check-prefixes=A2...
[truncated]

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 13, 2025

LLVM Buildbot has detected a new failure on builder sanitizer-x86_64-linux-fast running on sanitizer-buildbot4 while building llvm at step 2 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/11375

Here is the relevant piece of the build log for the reference
Step 2 (annotate) failure: 'python ../sanitizer_buildbot/sanitizers/zorg/buildbot/builders/sanitizers/buildbot_selector.py' (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89564 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80..
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s (45097 of 89564)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp && mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp # RUN: at line 1
+ rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
+ mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s # RUN: at line 2
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s # RUN: at line 4
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o     -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o # RUN: at line 6
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o
llvm-jitlink error: Symbols not found: [ _unresolvable_external, _used_unresolved_external ]
llvm-jitlink error: In main, failed to materialize { _anchor_test_case_pointers }, due to unsatisfied dependencies { (main, { _private_func_to_interpose_as_seen_by_test, _public_func_to_interpose_as_seen_by_test }) } (dependencies removed or in error state)
libc++abi: Pure virtual function called!
error: Aborted

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Slowest Tests:
--------------------------------------------------------------------------
590.72s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
378.07s: Clang :: Driver/fsanitize.c
309.54s: Clang :: Preprocessor/riscv-target-features.c
227.77s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp
223.65s: Clang :: OpenMP/target_update_codegen.cpp
220.15s: Clang :: Driver/arm-cortex-cpus-1.c
217.57s: Clang :: Driver/arm-cortex-cpus-2.c
203.59s: Clang :: Preprocessor/arm-target-features.c
198.76s: LLVM :: CodeGen/AMDGPU/memintrinsic-unroll.ll
196.07s: Clang :: Preprocessor/aarch64-target-features.c
172.20s: Clang :: Analysis/a_flaky_crash.cpp
168.35s: LLVM :: CodeGen/RISCV/attributes.ll
165.93s: Clang :: Preprocessor/predefined-arch-macros.c
Step 10 (stage2/asan_ubsan check) failure: stage2/asan_ubsan check (failure)
...
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using lld-link: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/lld-link
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using ld64.lld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/ld64.lld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/llvm/config.py:520: note: using wasm-ld: /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/wasm-ld
llvm-lit: /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/lit/lit/main.py:72: note: The test suite configuration requested an individual test timeout of 0 seconds but a timeout of 900 seconds was requested on the command line. Forcing timeout to be 900 seconds.
-- Testing: 89564 tests, 88 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80..
FAIL: LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s (45097 of 89564)
******************** TEST 'LLVM :: ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp && mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp # RUN: at line 1
+ rm -rf /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
+ mkdir -p /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s # RUN: at line 2
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/Inputs/MachO_test_harness_test.s
/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj    -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s # RUN: at line 4
+ /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s
not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o     -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o # RUN: at line 6
+ not /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/bin/llvm-jitlink -noexec -check /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/test/ExecutionEngine/JITLink/x86-64/MachO_test_harness_harness.s /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/file_to_test.o -harness /home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/test/ExecutionEngine/JITLink/x86-64/Output/MachO_test_harness_harness.s.tmp/test_harness.o
llvm-jitlink error: Symbols not found: [ _unresolvable_external, _used_unresolved_external ]
llvm-jitlink error: In main, failed to materialize { _anchor_test_case_pointers }, due to unsatisfied dependencies { (main, { _private_func_to_interpose_as_seen_by_test, _public_func_to_interpose_as_seen_by_test }) } (dependencies removed or in error state)
libc++abi: Pure virtual function called!
error: Aborted

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Slowest Tests:
--------------------------------------------------------------------------
590.72s: LLVM :: CodeGen/AMDGPU/sched-group-barrier-pipeline-solver.mir
378.07s: Clang :: Driver/fsanitize.c
309.54s: Clang :: Preprocessor/riscv-target-features.c
227.77s: Clang :: OpenMP/target_defaultmap_codegen_01.cpp
223.65s: Clang :: OpenMP/target_update_codegen.cpp
220.15s: Clang :: Driver/arm-cortex-cpus-1.c
217.57s: Clang :: Driver/arm-cortex-cpus-2.c
203.59s: Clang :: Preprocessor/arm-target-features.c
198.76s: LLVM :: CodeGen/AMDGPU/memintrinsic-unroll.ll
196.07s: Clang :: Preprocessor/aarch64-target-features.c
172.20s: Clang :: Analysis/a_flaky_crash.cpp
168.35s: LLVM :: CodeGen/RISCV/attributes.ll
165.93s: Clang :: Preprocessor/predefined-arch-macros.c

@llvm-ci
Copy link
Collaborator

llvm-ci commented May 13, 2025

LLVM Buildbot has detected a new failure on builder llvm-clang-win-x-armv7l running on as-builder-1 while building llvm at step 15 "test-check-cxx-armv7-unknown-linux-gnueabihf".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/38/builds/3382

Here is the relevant piece of the build log for the reference
Step 15 (test-check-cxx-armv7-unknown-linux-gnueabihf) failure: Test just built components: check-cxx-armv7-unknown-linux-gnueabihf completed (failure)
******************** TEST 'llvm-libc++-static.cfg.in :: std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
C:/buildbot/as-builder-1/x-armv7l/build/./bin/clang++.exe C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\replace.pass.cpp -pthread --target=armv7-unknown-linux-gnueabihf -nostdinc++ -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/armv7-unknown-linux-gnueabihf/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings  -lc++experimental -nostdlib++ -L C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/lib/armv7-unknown-linux-gnueabihf -lc++ -lc++abi -latomic -o C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir\t.tmp.exe
# executed command: C:/buildbot/as-builder-1/x-armv7l/build/./bin/clang++.exe 'C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\replace.pass.cpp' -pthread --target=armv7-unknown-linux-gnueabihf -nostdinc++ -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/include/armv7-unknown-linux-gnueabihf/c++/v1 -I C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Werror=thread-safety -Wuser-defined-warnings -lc++experimental -nostdlib++ -L C:/buildbot/as-builder-1/x-armv7l/build/runtimes/runtimes-armv7-unknown-linux-gnueabihf-bins/libcxx/test-suite-install/lib/armv7-unknown-linux-gnueabihf -lc++ -lc++abi -latomic -o 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir\t.tmp.exe'
# EXECUTED AS
"C:/Python310/python.exe" "C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/utils/ssh.py" [email protected] --execdir C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir --  C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir\t.tmp.exe
# executed command: C:/Python310/python.exe C:/buildbot/as-builder-1/x-armv7l/llvm-project/libcxx/utils/ssh.py [email protected] --execdir 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir' -- 'C:\buildbot\as-builder-1\x-armv7l\build\runtimes\runtimes-armv7-unknown-linux-gnueabihf-bins\libcxx\test\std\containers\container.adaptors\flat.map\flat.map.modifiers\Output\replace.pass.cpp.dir\t.tmp.exe'
# .---command stderr------------
# | scp: Connection closed
# | Traceback (most recent call last):
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 145, in <module>
# |     exit(main())
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 97, in main
# |     runCommand(scp(tmpTar.name, remoteTarball), check=True, stdin=subprocess.DEVNULL)
# |   File "C:\buildbot\as-builder-1\x-armv7l\llvm-project\libcxx\utils\ssh.py", line 57, in runCommand
# |     return subprocess.run(command, *args_, **kwargs)
# |   File "c:\python310\lib\subprocess.py", line 524, in run
# |     raise CalledProcessError(retcode, process.args,
# | subprocess.CalledProcessError: Command '['scp', '-q', '-oBatchMode=yes', 'C:\\buildbot\\as-builder-1\\x-armv7l\\build\\lit-tmp-pvqqgd_f\\tmpoaiuz2tb.tar', '[email protected]:/tmp/libcxx.SSwF6yblQg/tmpoaiuz2tb.tar']' returned non-zero exit status 255.
# `-----------------------------
# error: command failed with exit status: 1

--

********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented May 13, 2025

LLVM Buildbot has detected a new failure on builder lld-x86_64-win running on as-worker-93 while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/146/builds/2907

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM-Unit :: Support/./SupportTests.exe/90/95' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe-LLVM-Unit-22300-90-95.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=95 GTEST_SHARD_INDEX=90 C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe
--

Script:
--
C:\a\lld-x86_64-win\build\unittests\Support\.\SupportTests.exe --gtest_filter=ProgramEnvTest.CreateProcessLongPath
--
C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp(160): error: Expected equality of these values:
  0
  RC
    Which is: -2

C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp(163): error: fs::remove(Twine(LongPath)): did not return errc::success.
error number: 13
error message: permission denied



C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp:160
Expected equality of these values:
  0
  RC
    Which is: -2

C:\a\lld-x86_64-win\llvm-project\llvm\unittests\Support\ProgramTest.cpp:163
fs::remove(Twine(LongPath)): did not return errc::success.
error number: 13
error message: permission denied




********************


dwblaikie pushed a commit that referenced this pull request May 13, 2025
Add support for gsym files to llvm-symbolizer.

co-author @sfc-gh-sgiesecke

Notes:
There was a PR that was 
approved and merged: #134847 
and reverted: #139660
Due to buildbot failures:
https://lab.llvm.org/buildbot/#/builders/66/builds/13851 - it looks like
related
https://lab.llvm.org/buildbot/#/builders/51/builds/16018 - it looks like
related
https://lab.llvm.org/buildbot/#/builders/146/builds/2905 - it looks like
it's not related to changes

Fix:
To fix missing GSYM symbols 
```
+ diff -u expected.new undefined.new
+_ZN4llvm4gsym10GsymReader8openFileENS_9StringRefE U
+_ZN4llvm4gsym10GsymReaderC1EOS1_ U
+_ZN4llvm4gsym10GsymReaderD1Ev U
+_ZN4llvm4gsym13GsymDIContextC1ENSt20__InternalSymbolizer10unique_ptrINS0_10GsymReaderENS2_14default_deleteIS4_EEEE U
+ echo 'Failed: unexpected symbols'
```
for script
compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
LLVMDebugInfoGSYM was added. 
Please check the commit:

ba55425
That's the only change compare to
#134847
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request May 13, 2025
Add support for gsym files to llvm-symbolizer.

co-author @sfc-gh-sgiesecke

Notes:
There was a PR that was
approved and merged: llvm/llvm-project#134847
and reverted: llvm/llvm-project#139660
Due to buildbot failures:
https://lab.llvm.org/buildbot/#/builders/66/builds/13851 - it looks like
related
https://lab.llvm.org/buildbot/#/builders/51/builds/16018 - it looks like
related
https://lab.llvm.org/buildbot/#/builders/146/builds/2905 - it looks like
it's not related to changes

Fix:
To fix missing GSYM symbols
```
+ diff -u expected.new undefined.new
+_ZN4llvm4gsym10GsymReader8openFileENS_9StringRefE U
+_ZN4llvm4gsym10GsymReaderC1EOS1_ U
+_ZN4llvm4gsym10GsymReaderD1Ev U
+_ZN4llvm4gsym13GsymDIContextC1ENSt20__InternalSymbolizer10unique_ptrINS0_10GsymReaderENS2_14default_deleteIS4_EEEE U
+ echo 'Failed: unexpected symbols'
```
for script
compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
LLVMDebugInfoGSYM was added.
Please check the commit:

llvm/llvm-project@ba55425
That's the only change compare to
llvm/llvm-project#134847
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants