Skip to content

Commit 72c3f6f

Browse files
committed
Revert "[lldb] Report old modules from ModuleList::ReplaceEquivalent"
This reverts commit abeec5d.
1 parent b50fbe8 commit 72c3f6f

File tree

3 files changed

+10
-39
lines changed

3 files changed

+10
-39
lines changed

lldb/include/lldb/Core/ModuleList.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,7 @@ class ModuleList {
139139
///
140140
/// \param[in] module_sp
141141
/// A shared pointer to a module to replace in this collection.
142-
///
143-
/// \param[in] old_modules
144-
/// Optional pointer to a vector which, if provided, will have shared
145-
/// pointers to the replaced module(s) appended to it.
146-
void ReplaceEquivalent(
147-
const lldb::ModuleSP &module_sp,
148-
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules = nullptr);
142+
void ReplaceEquivalent(const lldb::ModuleSP &module_sp);
149143

150144
/// Append a module to the module list, if it is not already there.
151145
///

lldb/source/Core/ModuleList.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ void ModuleList::Append(const ModuleSP &module_sp, bool notify) {
172172
AppendImpl(module_sp, notify);
173173
}
174174

175-
void ModuleList::ReplaceEquivalent(
176-
const ModuleSP &module_sp,
177-
llvm::SmallVectorImpl<lldb::ModuleSP> *old_modules) {
175+
void ModuleList::ReplaceEquivalent(const ModuleSP &module_sp) {
178176
if (module_sp) {
179177
std::lock_guard<std::recursive_mutex> guard(m_modules_mutex);
180178

@@ -187,14 +185,11 @@ void ModuleList::ReplaceEquivalent(
187185

188186
size_t idx = 0;
189187
while (idx < m_modules.size()) {
190-
ModuleSP test_module_sp(m_modules[idx]);
191-
if (test_module_sp->MatchesModuleSpec(equivalent_module_spec)) {
192-
if (old_modules)
193-
old_modules->push_back(test_module_sp);
188+
ModuleSP module_sp(m_modules[idx]);
189+
if (module_sp->MatchesModuleSpec(equivalent_module_spec))
194190
RemoveImpl(m_modules.begin() + idx);
195-
} else {
191+
else
196192
++idx;
197-
}
198193
}
199194
// Now add the new module to the list
200195
Append(module_sp);
@@ -818,7 +813,7 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
818813
*did_create_ptr = true;
819814
}
820815

821-
shared_module_list.ReplaceEquivalent(module_sp, old_modules);
816+
shared_module_list.ReplaceEquivalent(module_sp);
822817
return error;
823818
}
824819
}
@@ -855,7 +850,7 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
855850
if (did_create_ptr)
856851
*did_create_ptr = true;
857852

858-
shared_module_list.ReplaceEquivalent(module_sp, old_modules);
853+
shared_module_list.ReplaceEquivalent(module_sp);
859854
return Status();
860855
}
861856
}
@@ -953,7 +948,7 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
953948
if (did_create_ptr)
954949
*did_create_ptr = true;
955950

956-
shared_module_list.ReplaceEquivalent(module_sp, old_modules);
951+
shared_module_list.ReplaceEquivalent(module_sp);
957952
}
958953
} else {
959954
located_binary_modulespec.GetFileSpec().GetPath(path, sizeof(path));

lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ def verify_module(self, module, verify_path, verify_uuid):
3131
os.path.normcase(module.GetFileSpec().dirname or ""))
3232
self.assertEqual(verify_uuid, module.GetUUIDString())
3333

34-
def get_minidump_modules(self, yaml_file, exe = None):
34+
def get_minidump_modules(self, yaml_file):
3535
minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp")
3636
self.yaml2obj(yaml_file, minidump_path)
37-
self.target = self.dbg.CreateTarget(exe)
37+
self.target = self.dbg.CreateTarget(None)
3838
self.process = self.target.LoadCore(minidump_path)
3939
return self.target.modules
4040

@@ -265,24 +265,6 @@ def test_breakpad_overflow_hash_match(self):
265265
# will check that this matches.
266266
self.verify_module(modules[0], so_path, "48EB9FD7")
267267

268-
def test_breakpad_hash_match_exe_outside_sysroot(self):
269-
"""
270-
Check that we can match the breakpad .text section hash when the
271-
module is specified as the exe during launch, and a syroot is
272-
provided, which does not contain the exe.
273-
"""
274-
sysroot_path = os.path.join(self.getBuildDir(), "mock_sysroot")
275-
lldbutil.mkdir_p(sysroot_path)
276-
so_dir = os.path.join(self.getBuildDir(), "binary")
277-
so_path = os.path.join(so_dir, "libbreakpad.so")
278-
lldbutil.mkdir_p(so_dir)
279-
self.yaml2obj("libbreakpad.yaml", so_path)
280-
self.runCmd("platform select remote-linux --sysroot '%s'" % sysroot_path)
281-
modules = self.get_minidump_modules("linux-arm-breakpad-uuid-match.yaml", so_path)
282-
self.assertEqual(1, len(modules))
283-
# LLDB makes up its own UUID as well when there is no build ID so we
284-
# will check that this matches.
285-
self.verify_module(modules[0], so_path, "D9C480E8")
286268

287269
def test_facebook_hash_match(self):
288270
"""

0 commit comments

Comments
 (0)