[Lldb-commits] [lldb] 6443d0d - [lldb] Remove reproducer logic from LocateSymbolFileMacOSX

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 13 16:27:10 PDT 2022


Author: Jonas Devlieghere
Date: 2022-04-13T16:27:02-07:00
New Revision: 6443d0d413df7b67b149e7618c295c38869ecbcb

URL: https://github.com/llvm/llvm-project/commit/6443d0d413df7b67b149e7618c295c38869ecbcb
DIFF: https://github.com/llvm/llvm-project/commit/6443d0d413df7b67b149e7618c295c38869ecbcb.diff

LOG: [lldb] Remove reproducer logic from LocateSymbolFileMacOSX

Added: 
    

Modified: 
    lldb/source/Symbol/LocateSymbolFileMacOSX.cpp

Removed: 
    lldb/test/Shell/Reproducer/Inputs/dsymforuuid.sh
    lldb/test/Shell/Reproducer/TestDebugSymbols.test


################################################################################
diff  --git a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
index 9f19634960b31..8564bcc2c6bf0 100644
--- a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
+++ b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
@@ -28,7 +28,6 @@
 #include "lldb/Utility/Endian.h"
 #include "lldb/Utility/LLDBLog.h"
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/ReproducerProvider.h"
 #include "lldb/Utility/StreamString.h"
 #include "lldb/Utility/Timer.h"
 #include "lldb/Utility/UUID.h"
@@ -60,14 +59,6 @@ int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
   const UUID *uuid = module_spec.GetUUIDPtr();
   const ArchSpec *arch = module_spec.GetArchitecturePtr();
 
-  if (repro::Loader *l = repro::Reproducer::Instance().GetLoader()) {
-    static repro::SymbolFileLoader symbol_file_loader(l);
-    std::pair<FileSpec, FileSpec> paths = symbol_file_loader.GetPaths(uuid);
-    return_module_spec.GetFileSpec() = paths.first;
-    return_module_spec.GetSymbolFileSpec() = paths.second;
-    return 1;
-  }
-
   int items_found = 0;
 
   if (g_dlsym_DBGCopyFullDSYMURLForUUID == nullptr ||
@@ -264,12 +255,6 @@ int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
     }
   }
 
-  if (repro::Generator *g = repro::Reproducer::Instance().GetGenerator()) {
-    g->GetOrCreate<repro::SymbolFileProvider>().AddSymbolFile(
-        uuid, return_module_spec.GetFileSpec(),
-        return_module_spec.GetSymbolFileSpec());
-  }
-
   return items_found;
 }
 
@@ -477,25 +462,6 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
   const UUID *uuid_ptr = module_spec.GetUUIDPtr();
   const FileSpec *file_spec_ptr = module_spec.GetFileSpecPtr();
 
-  if (repro::Loader *l = repro::Reproducer::Instance().GetLoader()) {
-    static repro::SymbolFileLoader symbol_file_loader(l);
-    std::pair<FileSpec, FileSpec> paths = symbol_file_loader.GetPaths(uuid_ptr);
-    if (paths.first)
-      module_spec.GetFileSpec() = paths.first;
-    if (paths.second)
-      module_spec.GetSymbolFileSpec() = paths.second;
-    return true;
-  }
-
-  // Lambda to capture the state of module_spec before returning from this
-  // function.
-  auto RecordResult = [&]() {
-    if (repro::Generator *g = repro::Reproducer::Instance().GetGenerator()) {
-      g->GetOrCreate<repro::SymbolFileProvider>().AddSymbolFile(
-          uuid_ptr, module_spec.GetFileSpec(), module_spec.GetSymbolFileSpec());
-    }
-  };
-
   // It's expensive to check for the DBGShellCommands defaults setting, only do
   // it once per lldb run and cache the result.
   static bool g_have_checked_for_dbgshell_command = false;
@@ -521,7 +487,6 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
   // When g_dbgshell_command is NULL, the user has not enabled the use of an
   // external program to find the symbols, don't run it for them.
   if (!force_lookup && g_dbgshell_command == NULL) {
-    RecordResult();
     return false;
   }
 
@@ -648,7 +613,6 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
                 if (num_values == 1) {
                   success = GetModuleSpecInfoFromUUIDDictionary(values[0],
                                                                 module_spec);
-                  RecordResult();
                   return success;
                 } else {
                   for (CFIndex i = 0; i < num_values; ++i) {
@@ -658,7 +622,6 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
                       if (module_spec.GetArchitecture().IsCompatibleMatch(
                               curr_module_spec.GetArchitecture())) {
                         module_spec = curr_module_spec;
-                        RecordResult();
                         return true;
                       }
                     }
@@ -680,6 +643,5 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
       }
     }
   }
-  RecordResult();
   return success;
 }

diff  --git a/lldb/test/Shell/Reproducer/Inputs/dsymforuuid.sh b/lldb/test/Shell/Reproducer/Inputs/dsymforuuid.sh
deleted file mode 100755
index ce5ade741ed65..0000000000000
--- a/lldb/test/Shell/Reproducer/Inputs/dsymforuuid.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/env bash
-
-echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-echo "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//ENhttp://www.apple.com/DTDs/PropertyList-1.0.dtd\">"
-echo "<plist version=\"1.0\">"
-echo "<dict>"
-echo "    <key>AD52358C-94F8-3796-ADD6-B20FFAC00E5C</key>"
-echo "    <dict>"
-echo "        <key>DBGArchitecture</key>"
-echo "        <string>x86_64</string>"
-echo "        <key>DBGBuildSourcePath</key>"
-echo "        <string>/path/to/build/sources</string>"
-echo "        <key>DBGSourcePath</key>"
-echo "        <string>/path/to/actual/sources</string>"
-echo "        <key>DBGDSYMPath</key>"
-echo "        <string>/path/to/foo.dSYM/Contents/Resources/DWARF/foo</string>"
-echo "        <key>DBGSymbolRichExecutable</key>"
-echo "        <string>/path/to/unstripped/executable</string>"
-echo "    </dict>"
-echo "</dict>"
-echo "</plist>"

diff  --git a/lldb/test/Shell/Reproducer/TestDebugSymbols.test b/lldb/test/Shell/Reproducer/TestDebugSymbols.test
deleted file mode 100644
index 6a3cc1249cbd1..0000000000000
--- a/lldb/test/Shell/Reproducer/TestDebugSymbols.test
+++ /dev/null
@@ -1,14 +0,0 @@
-# REQUIRES: system-darwin
-
-# RUN: rm -rf %t.repro
-# RUN: env LLDB_APPLE_DSYMFORUUID_EXECUTABLE=%S/Inputs/dsymforuuid.sh %lldb --capture --capture-path %t.repro -c %S/Inputs/core -o 'reproducer generate'
-
-# RUN: cat %t.repro/symbol-files.yaml | FileCheck %s --check-prefix YAML
-# YAML: AD52358C-94F8-3796-ADD6-B20FFAC00E5C
-# YAML: /path/to/unstripped/executable
-# YAML: /path/to/foo.dSYM/Contents/Resources/DWARF/foo
-
-# RUN: %lldb -b -o 'reproducer dump -p symbol-files -f %t.repro' | FileCheck %s --check-prefix DUMP
-# DUMP: uuid: AD52358C-94F8-3796-ADD6-B20FFAC00E5C
-# DUMP-NEXT: module path: /path/to/unstripped/executable
-# DUMP-NEXT: symbol path: /path/to/foo.dSYM/Contents/Resources/DWARF/foo


        


More information about the lldb-commits mailing list