Skip to content

Commit 7fc2fbb

Browse files
committed
Revert "DebugInfoD tests + fixing issues exposed by tests (#85693)"
This reverts commit 6d939a6. This broke following LLDB bots: https://lab.llvm.org/buildbot/#/builders/96/builds/54867 https://lab.llvm.org/buildbot/#/builders/17/builds/50824
1 parent 4406e4a commit 7fc2fbb

File tree

10 files changed

+17
-537
lines changed

10 files changed

+17
-537
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
5151
#
5252
# GNUWin32 uname gives "windows32" or "server version windows32" while
5353
# some versions of MSYS uname return "MSYS_NT*", but most environments
54-
# standardize on "Windows_NT", so we'll make it consistent here.
54+
# standardize on "Windows_NT", so we'll make it consistent here.
5555
# When running tests from Visual Studio, the environment variable isn't
5656
# inherited all the way down to the process spawned for make.
5757
#----------------------------------------------------------------------
@@ -210,12 +210,6 @@ else
210210
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
211211
DSYM = $(EXE).debug
212212
endif
213-
214-
ifeq "$(MAKE_DWP)" "YES"
215-
MAKE_DWO := YES
216-
DWP_NAME = $(EXE).dwp
217-
DYLIB_DWP_NAME = $(DYLIB_NAME).dwp
218-
endif
219213
endif
220214

221215
LIMIT_DEBUG_INFO_FLAGS =
@@ -363,7 +357,6 @@ ifneq "$(OS)" "Darwin"
363357

364358
OBJCOPY ?= $(call replace_cc_with,objcopy)
365359
ARCHIVER ?= $(call replace_cc_with,ar)
366-
DWP ?= $(call replace_cc_with,dwp)
367360
override AR = $(ARCHIVER)
368361
endif
369362

@@ -534,10 +527,6 @@ ifneq "$(CXX)" ""
534527
endif
535528
endif
536529

537-
ifeq "$(GEN_GNU_BUILD_ID)" "YES"
538-
LDFLAGS += -Wl,--build-id
539-
endif
540-
541530
#----------------------------------------------------------------------
542531
# DYLIB_ONLY variable can be used to skip the building of a.out.
543532
# See the sections below regarding dSYM file as well as the building of
@@ -576,25 +565,11 @@ else
576565
endif
577566
else
578567
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
579-
ifeq "$(SAVE_FULL_DEBUG_BINARY)" "YES"
580-
cp "$(EXE)" "$(EXE).full"
581-
endif
582568
$(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)"
583569
$(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)"
584570
endif
585-
ifeq "$(MAKE_DWP)" "YES"
586-
$(DWP) -o "$(DWP_NAME)" $(DWOS)
587-
endif
588571
endif
589572

590-
591-
#----------------------------------------------------------------------
592-
# Support emitting the content of the GNU build-id into a file
593-
# This needs to be used in conjunction with GEN_GNU_BUILD_ID := YES
594-
#----------------------------------------------------------------------
595-
$(EXE).uuid : $(EXE)
596-
$(OBJCOPY) --dump-section=.note.gnu.build-id=$@ $<
597-
598573
#----------------------------------------------------------------------
599574
# Make the dylib
600575
#----------------------------------------------------------------------
@@ -635,15 +610,9 @@ endif
635610
else
636611
$(LD) $(DYLIB_OBJECTS) $(LDFLAGS) -shared -o "$(DYLIB_FILENAME)"
637612
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
638-
ifeq "$(SAVE_FULL_DEBUG_BINARY)" "YES"
639-
cp "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).full"
640-
endif
641613
$(OBJCOPY) --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug"
642614
$(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)"
643615
endif
644-
ifeq "$(MAKE_DWP)" "YES"
645-
$(DWP) -o $(DYLIB_DWP_FILE) $(DYLIB_DWOS)
646-
endif
647616
endif
648617

649618
#----------------------------------------------------------------------

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4377,38 +4377,26 @@ const std::shared_ptr<SymbolFileDWARFDwo> &SymbolFileDWARF::GetDwpSymbolFile() {
43774377
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
43784378
ModuleSpec module_spec;
43794379
module_spec.GetFileSpec() = m_objfile_sp->GetFileSpec();
4380-
FileSpec dwp_filespec;
43814380
for (const auto &symfile : symfiles.files()) {
43824381
module_spec.GetSymbolFileSpec() =
43834382
FileSpec(symfile.GetPath() + ".dwp", symfile.GetPathStyle());
43844383
LLDB_LOG(log, "Searching for DWP using: \"{0}\"",
43854384
module_spec.GetSymbolFileSpec());
4386-
dwp_filespec =
4385+
FileSpec dwp_filespec =
43874386
PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
43884387
if (FileSystem::Instance().Exists(dwp_filespec)) {
4389-
break;
4390-
}
4391-
}
4392-
if (!FileSystem::Instance().Exists(dwp_filespec)) {
4393-
LLDB_LOG(log, "No DWP file found locally");
4394-
// Fill in the UUID for the module we're trying to match for, so we can
4395-
// find the correct DWP file, as the Debuginfod plugin uses *only* this
4396-
// data to correctly match the DWP file with the binary.
4397-
module_spec.GetUUID() = m_objfile_sp->GetUUID();
4398-
dwp_filespec =
4399-
PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
4400-
}
4401-
if (FileSystem::Instance().Exists(dwp_filespec)) {
4402-
LLDB_LOG(log, "Found DWP file: \"{0}\"", dwp_filespec);
4403-
DataBufferSP dwp_file_data_sp;
4404-
lldb::offset_t dwp_file_data_offset = 0;
4405-
ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
4406-
GetObjectFile()->GetModule(), &dwp_filespec, 0,
4407-
FileSystem::Instance().GetByteSize(dwp_filespec), dwp_file_data_sp,
4408-
dwp_file_data_offset);
4409-
if (dwp_obj_file) {
4410-
m_dwp_symfile = std::make_shared<SymbolFileDWARFDwo>(
4411-
*this, dwp_obj_file, DIERef::k_file_index_mask);
4388+
LLDB_LOG(log, "Found DWP file: \"{0}\"", dwp_filespec);
4389+
DataBufferSP dwp_file_data_sp;
4390+
lldb::offset_t dwp_file_data_offset = 0;
4391+
ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
4392+
GetObjectFile()->GetModule(), &dwp_filespec, 0,
4393+
FileSystem::Instance().GetByteSize(dwp_filespec), dwp_file_data_sp,
4394+
dwp_file_data_offset);
4395+
if (dwp_obj_file) {
4396+
m_dwp_symfile = std::make_shared<SymbolFileDWARFDwo>(
4397+
*this, dwp_obj_file, DIERef::k_file_index_mask);
4398+
break;
4399+
}
44124400
}
44134401
}
44144402
if (!m_dwp_symfile) {
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
# Order matters here: the first symbol locator prevents further searching.
2-
# For DWARF binaries that are both stripped and split, the Default plugin
3-
# will return the stripped binary when asked for the ObjectFile, which then
4-
# prevents an unstripped binary from being requested from the Debuginfod
5-
# provider.
6-
add_subdirectory(Debuginfod)
71
add_subdirectory(Default)
82
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
93
add_subdirectory(DebugSymbols)
104
endif()
5+
add_subdirectory(Debuginfod)

lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,6 @@ llvm::StringRef SymbolVendorELF::GetPluginDescriptionStatic() {
4444
"executables.";
4545
}
4646

47-
// If this is needed elsewhere, it can be exported/moved.
48-
static bool IsDwpSymbolFile(const lldb::ModuleSP &module_sp,
49-
const FileSpec &file_spec) {
50-
DataBufferSP dwp_file_data_sp;
51-
lldb::offset_t dwp_file_data_offset = 0;
52-
// Try to create an ObjectFile from the file_spec.
53-
ObjectFileSP dwp_obj_file = ObjectFile::FindPlugin(
54-
module_sp, &file_spec, 0, FileSystem::Instance().GetByteSize(file_spec),
55-
dwp_file_data_sp, dwp_file_data_offset);
56-
if (!ObjectFileELF::classof(dwp_obj_file.get()))
57-
return false;
58-
// The presence of a debug_cu_index section is the key identifying feature of
59-
// a DWP file. Make sure we don't fill in the section list on dwp_obj_file
60-
// (by calling GetSectionList(false)) as this is invoked before we may have
61-
// all the symbol files collected and available.
62-
return dwp_obj_file && dwp_obj_file->GetSectionList(false)->FindSectionByType(
63-
eSectionTypeDWARFDebugCuIndex, false);
64-
}
65-
6647
// CreateInstance
6748
//
6849
// Platforms can register a callback to use when creating symbol vendors to
@@ -106,15 +87,8 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
10687
FileSpecList search_paths = Target::GetDefaultDebugFileSearchPaths();
10788
FileSpec dsym_fspec =
10889
PluginManager::LocateExecutableSymbolFile(module_spec, search_paths);
109-
if (!dsym_fspec || IsDwpSymbolFile(module_sp, dsym_fspec)) {
110-
// If we have a stripped binary or if we got a DWP file, we should prefer
111-
// symbols in the executable acquired through a plugin.
112-
ModuleSpec unstripped_spec =
113-
PluginManager::LocateExecutableObjectFile(module_spec);
114-
if (!unstripped_spec)
115-
return nullptr;
116-
dsym_fspec = unstripped_spec.GetFileSpec();
117-
}
90+
if (!dsym_fspec)
91+
return nullptr;
11892

11993
DataBufferSP dsym_file_data_sp;
12094
lldb::offset_t dsym_file_data_offset = 0;

lldb/test/API/debuginfod/Normal/Makefile

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)