Differential D81465 Diff 269649 lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
Changeset View
Changeset View
Standalone View
Standalone View
lldb/test/API/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py
Show All 13 Lines | |||||
class MiniDumpUUIDTestCase(TestBase): | class MiniDumpUUIDTestCase(TestBase): | ||||
mydir = TestBase.compute_mydir(__file__) | mydir = TestBase.compute_mydir(__file__) | ||||
NO_DEBUG_INFO_TESTCASE = True | NO_DEBUG_INFO_TESTCASE = True | ||||
def verify_module(self, module, verify_path, verify_uuid): | def verify_module(self, module, verify_path, verify_uuid): | ||||
uuid = module.GetUUIDString() | # Compare the filename and the directory separately. We are avoiding | ||||
self.assertEqual(verify_path, module.GetFileSpec().fullpath) | # SBFileSpec.fullpath because it causes a slash/backslash confusion | ||||
self.assertEqual(verify_uuid, uuid) | # on Windows. | ||||
self.assertEqual( | |||||
os.path.basename(verify_path), module.GetFileSpec().basename) | |||||
self.assertEqual( | |||||
os.path.dirname(verify_path), module.GetFileSpec().dirname or "") | |||||
self.assertEqual(verify_uuid, module.GetUUIDString()) | |||||
def get_minidump_modules(self, yaml_file): | def get_minidump_modules(self, yaml_file): | ||||
minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp") | minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp") | ||||
self.yaml2obj(yaml_file, minidump_path) | self.yaml2obj(yaml_file, minidump_path) | ||||
self.target = self.dbg.CreateTarget(None) | self.target = self.dbg.CreateTarget(None) | ||||
self.process = self.target.LoadCore(minidump_path) | self.process = self.target.LoadCore(minidump_path) | ||||
return self.target.modules | return self.target.modules | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | def test_uuid_modules_elf_build_id_same(self): | ||||
""" | """ | ||||
modules = self.get_minidump_modules("linux-arm-same-uuids.yaml") | modules = self.get_minidump_modules("linux-arm-same-uuids.yaml") | ||||
self.assertEqual(2, len(modules)) | self.assertEqual(2, len(modules)) | ||||
self.verify_module(modules[0], "/file/does/not/exist/a", | self.verify_module(modules[0], "/file/does/not/exist/a", | ||||
'11223344-1122-3344-1122-334411223344-11223344') | '11223344-1122-3344-1122-334411223344-11223344') | ||||
self.verify_module(modules[1], "/file/does/not/exist/b", | self.verify_module(modules[1], "/file/does/not/exist/b", | ||||
'11223344-1122-3344-1122-334411223344-11223344') | '11223344-1122-3344-1122-334411223344-11223344') | ||||
@expectedFailureAll(oslist=["windows"]) | |||||
def test_partial_uuid_match(self): | def test_partial_uuid_match(self): | ||||
""" | """ | ||||
Breakpad has been known to create minidump files using CvRecord in each | Breakpad has been known to create minidump files using CvRecord in each | ||||
module whose signature is set to PDB70 where the UUID only contains the | module whose signature is set to PDB70 where the UUID only contains the | ||||
first 16 bytes of a 20 byte ELF build ID. Code was added to | first 16 bytes of a 20 byte ELF build ID. Code was added to | ||||
ProcessMinidump.cpp to deal with this and allows partial UUID matching. | ProcessMinidump.cpp to deal with this and allows partial UUID matching. | ||||
This test verifies that if we have a minidump with a 16 byte UUID, that | This test verifies that if we have a minidump with a 16 byte UUID, that | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | def test_add_module_build_id_4(self): | ||||
"/some/local/b.so", "", "0A141E28")) | "/some/local/b.so", "", "0A141E28")) | ||||
# Adding modules with non-existing UUID should fail. | # Adding modules with non-existing UUID should fail. | ||||
self.assertFalse( | self.assertFalse( | ||||
self.target.AddModule( | self.target.AddModule( | ||||
"a", "", "01020304-0506-0708-090A-0B0C0D0E0F10").IsValid()) | "a", "", "01020304-0506-0708-090A-0B0C0D0E0F10").IsValid()) | ||||
self.assertFalse(self.target.AddModule("a", "", "01020305").IsValid()) | self.assertFalse(self.target.AddModule("a", "", "01020305").IsValid()) | ||||
@expectedFailureAll(oslist=["windows"]) | |||||
def test_remove_placeholder_add_real_module(self): | def test_remove_placeholder_add_real_module(self): | ||||
""" | """ | ||||
Test that removing a placeholder module and adding back the real | Test that removing a placeholder module and adding back the real | ||||
module succeeds. | module succeeds. | ||||
""" | """ | ||||
so_path = self.getBuildArtifact("libuuidmatch.so") | so_path = self.getBuildArtifact("libuuidmatch.so") | ||||
self.yaml2obj("libuuidmatch.yaml", so_path) | self.yaml2obj("libuuidmatch.yaml", so_path) | ||||
modules = self.get_minidump_modules("linux-arm-uuids-match.yaml") | modules = self.get_minidump_modules("linux-arm-uuids-match.yaml") | ||||
Show All 11 Lines |