|
8 | 8 | import shutil
|
9 | 9 |
|
10 | 10 | import lldb
|
| 11 | +import os |
11 | 12 | from lldbsuite.test.decorators import *
|
12 | 13 | from lldbsuite.test.lldbtest import *
|
13 | 14 | from lldbsuite.test import lldbutil
|
@@ -132,3 +133,55 @@ def test_uuid_modules_elf_build_id_zero(self):
|
132 | 133 | self.assertEqual(2, len(modules))
|
133 | 134 | self.verify_module(modules[0], "/not/exist/a", None)
|
134 | 135 | self.verify_module(modules[1], "/not/exist/b", None)
|
| 136 | + |
| 137 | + @expectedFailureAll(oslist=["windows"]) |
| 138 | + def test_partial_uuid_match(self): |
| 139 | + """ |
| 140 | + Breakpad has been known to create minidump files using CvRecord in each |
| 141 | + module whose signature is set to PDB70 where the UUID only contains the |
| 142 | + first 16 bytes of a 20 byte ELF build ID. Code was added to |
| 143 | + ProcessMinidump.cpp to deal with this and allows partial UUID matching. |
| 144 | +
|
| 145 | + This test verifies that if we have a minidump with a 16 byte UUID, that |
| 146 | + we are able to associate a symbol file with a 20 byte UUID only if the |
| 147 | + first 16 bytes match. In this case we will see the path from the file |
| 148 | + we found in the test directory and the 20 byte UUID from the actual |
| 149 | + file, not the 16 byte shortened UUID from the minidump. |
| 150 | + """ |
| 151 | + so_path = self.getBuildArtifact("libuuidmatch.so") |
| 152 | + self.yaml2obj("libuuidmatch.yaml", so_path) |
| 153 | + self.dbg.CreateTarget(None) |
| 154 | + self.target = self.dbg.GetSelectedTarget() |
| 155 | + cmd = 'settings set target.exec-search-paths "%s"' % (os.path.dirname(so_path)) |
| 156 | + self.dbg.HandleCommand(cmd) |
| 157 | + self.process = self.target.LoadCore("linux-arm-partial-uuids-match.dmp") |
| 158 | + modules = self.target.modules |
| 159 | + self.assertEqual(1, len(modules)) |
| 160 | + self.verify_module(modules[0], so_path, |
| 161 | + "7295E17C-6668-9E05-CBB5-DEE5003865D5-5267C116") |
| 162 | + |
| 163 | + @expectedFailureAll(oslist=["windows"]) |
| 164 | + def test_partial_uuid_mismatch(self): |
| 165 | + """ |
| 166 | + Breakpad has been known to create minidump files using CvRecord in each |
| 167 | + module whose signature is set to PDB70 where the UUID only contains the |
| 168 | + first 16 bytes of a 20 byte ELF build ID. Code was added to |
| 169 | + ProcessMinidump.cpp to deal with this and allows partial UUID matching. |
| 170 | + |
| 171 | + This test verifies that if we have a minidump with a 16 byte UUID, that |
| 172 | + we are not able to associate a symbol file with a 20 byte UUID only if |
| 173 | + any of the first 16 bytes do not match. In this case we will see the UUID |
| 174 | + from the minidump file and the path from the minidump file. |
| 175 | + """ |
| 176 | + so_path = self.getBuildArtifact("libuuidmismatch.so") |
| 177 | + self.yaml2obj("libuuidmismatch.yaml", so_path) |
| 178 | + self.dbg.CreateTarget(None) |
| 179 | + self.target = self.dbg.GetSelectedTarget() |
| 180 | + cmd = 'settings set target.exec-search-paths "%s"' % (os.path.dirname(so_path)) |
| 181 | + self.dbg.HandleCommand(cmd) |
| 182 | + self.process = self.target.LoadCore("linux-arm-partial-uuids-mismatch.dmp") |
| 183 | + modules = self.target.modules |
| 184 | + self.assertEqual(1, len(modules)) |
| 185 | + self.verify_module(modules[0], |
| 186 | + "/invalid/path/on/current/system/libuuidmismatch.so", |
| 187 | + "7295E17C-6668-9E05-CBB5-DEE5003865D5") |
0 commit comments