[lldb] Remove reproducer logic from LocateSymbolFileMacOSX

This commit is contained in:
Jonas Devlieghere 2022-04-13 15:29:21 -07:00
parent 80c600fe98
commit 6443d0d413
No known key found for this signature in database
GPG Key ID: 49CC0BD90FDEED4D
3 changed files with 0 additions and 73 deletions

View File

@ -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;
}

View File

@ -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>"

View File

@ -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