diff options
author | Pavel Labath <pavel@labath.sk> | 2019-04-23 08:49:39 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-04-23 08:49:39 +0000 |
commit | ed4f48d290e342657798437538c8aa8e1ef35c72 (patch) | |
tree | 5e4503151803d6651962d9ef6a62b95bafdb4c43 /lldb/packages/Python/lldbsuite/test | |
parent | 8f8827014d6e095d0d7f1002fdec30fe47a6d7a3 (diff) | |
download | bcm5719-llvm-ed4f48d290e342657798437538c8aa8e1ef35c72.tar.gz bcm5719-llvm-ed4f48d290e342657798437538c8aa8e1ef35c72.zip |
yamlify TestMiniDumpUUID binaries
Summary:
Instead of checking in raw minidump binaries, check in their yaml form,
and call yaml2obj in the test.
Reviewers: clayborg
Subscribers: javed.absar, lldb-commits
Differential Revision: https://reviews.llvm.org/D60948
llvm-svn: 358957
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
19 files changed, 183 insertions, 34 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py index 8ea3540a0d5..8a69d1cadb6 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpUUID.py @@ -33,6 +33,13 @@ class MiniDumpUUIDTestCase(TestBase): self.assertEqual(verify_path, module.GetFileSpec().fullpath) self.assertEqual(verify_uuid, uuid) + def get_minidump_modules(self, yaml_file): + minidump_path = self.getBuildArtifact(yaml_file + ".dmp") + self.yaml2obj(yaml_file, minidump_path) + self.target = self.dbg.CreateTarget(None) + self.process = self.target.LoadCore(minidump_path) + return self.target.modules + def test_zero_uuid_modules(self): """ Test multiple modules having a MINIDUMP_MODULE.CvRecord that is valid, @@ -42,10 +49,7 @@ class MiniDumpUUIDTestCase(TestBase): ensure that the UUID is not valid for each module and that we have each of the modules in the target after loading the core """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-zero-uuids.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-zero-uuids.yaml") self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/file/does/not/exist/a", None) self.verify_module(modules[1], "/file/does/not/exist/b", None) @@ -56,9 +60,7 @@ class MiniDumpUUIDTestCase(TestBase): and contains a PDB70 value whose age is zero and whose UUID values are valid. Ensure we decode the UUID and don't include the age field in the UUID. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-uuids-no-age.dmp") + modules = self.get_minidump_modules("linux-arm-uuids-no-age.yaml") modules = self.target.modules self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/tmp/a", "01020304-0506-0708-090A-0B0C0D0E0F10") @@ -73,9 +75,7 @@ class MiniDumpUUIDTestCase(TestBase): two uint16_t values. Breakpad incorrectly byte swaps these values when it saves Darwin minidump files. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("macos-arm-uuids-no-age.dmp") + modules = self.get_minidump_modules("macos-arm-uuids-no-age.yaml") modules = self.target.modules self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/tmp/a", "04030201-0605-0807-090A-0B0C0D0E0F10") @@ -87,10 +87,7 @@ class MiniDumpUUIDTestCase(TestBase): and contains a PDB70 value whose age is valid and whose UUID values are valid. Ensure we decode the UUID and include the age field in the UUID. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-uuids-with-age.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-uuids-with-age.yaml") self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/tmp/a", "01020304-0506-0708-090A-0B0C0D0E0F10-10101010") self.verify_module(modules[1], "/tmp/b", "0A141E28-323C-4650-5A64-6E78828C96A0-20202020") @@ -100,10 +97,7 @@ class MiniDumpUUIDTestCase(TestBase): Test multiple modules having a MINIDUMP_MODULE.CvRecord that is valid, and contains a ELF build ID whose value is valid and is 16 bytes long. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-uuids-elf-build-id-16.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-uuids-elf-build-id-16.yaml") self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/tmp/a", "01020304-0506-0708-090A-0B0C0D0E0F10") self.verify_module(modules[1], "/tmp/b", "0A141E28-323C-4650-5A64-6E78828C96A0") @@ -113,10 +107,7 @@ class MiniDumpUUIDTestCase(TestBase): Test multiple modules having a MINIDUMP_MODULE.CvRecord that is valid, and contains a ELF build ID whose value is valid and is 20 bytes long. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-uuids-elf-build-id-20.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-uuids-elf-build-id-20.yaml") self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/tmp/a", "01020304-0506-0708-090A-0B0C0D0E0F10-11121314") self.verify_module(modules[1], "/tmp/b", "0A141E28-323C-4650-5A64-6E78828C96A0-AAB4BEC8") @@ -126,10 +117,7 @@ class MiniDumpUUIDTestCase(TestBase): Test multiple modules having a MINIDUMP_MODULE.CvRecord that is valid, and contains a ELF build ID whose value is all zero. """ - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() - self.process = self.target.LoadCore("linux-arm-uuids-elf-build-id-zero.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-uuids-elf-build-id-zero.yaml") self.assertEqual(2, len(modules)) self.verify_module(modules[0], "/not/exist/a", None) self.verify_module(modules[1], "/not/exist/b", None) @@ -150,12 +138,9 @@ class MiniDumpUUIDTestCase(TestBase): """ so_path = self.getBuildArtifact("libuuidmatch.so") self.yaml2obj("libuuidmatch.yaml", so_path) - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() cmd = 'settings set target.exec-search-paths "%s"' % (os.path.dirname(so_path)) self.dbg.HandleCommand(cmd) - self.process = self.target.LoadCore("linux-arm-partial-uuids-match.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-partial-uuids-match.yaml") self.assertEqual(1, len(modules)) self.verify_module(modules[0], so_path, "7295E17C-6668-9E05-CBB5-DEE5003865D5-5267C116") @@ -174,12 +159,9 @@ class MiniDumpUUIDTestCase(TestBase): """ so_path = self.getBuildArtifact("libuuidmismatch.so") self.yaml2obj("libuuidmismatch.yaml", so_path) - self.dbg.CreateTarget(None) - self.target = self.dbg.GetSelectedTarget() cmd = 'settings set target.exec-search-paths "%s"' % (os.path.dirname(so_path)) self.dbg.HandleCommand(cmd) - self.process = self.target.LoadCore("linux-arm-partial-uuids-mismatch.dmp") - modules = self.target.modules + modules = self.get_minidump_modules("linux-arm-partial-uuids-mismatch.yaml") self.assertEqual(1, len(modules)) self.verify_module(modules[0], "/invalid/path/on/current/system/libuuidmismatch.so", diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.dmp Binary files differdeleted file mode 100644 index 12045dacb4e..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.yaml new file mode 100644 index 00000000000..edb0001ff27 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-match.yaml @@ -0,0 +1,15 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/invalid/path/on/current/system/libuuidmatch.so' + CodeView Record: 525344537295E17C66689E05CBB5DEE5003865D50000000000 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.dmp Binary files differdeleted file mode 100644 index c5c610e63b1..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.yaml new file mode 100644 index 00000000000..0b56a967bf6 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-partial-uuids-mismatch.yaml @@ -0,0 +1,15 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/invalid/path/on/current/system/libuuidmismatch.so' + CodeView Record: 525344537295E17C66689E05CBB5DEE5003865D50000000000 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.dmp Binary files differdeleted file mode 100644 index df24fef6d38..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.yaml new file mode 100644 index 00000000000..f4c18b93334 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-16.yaml @@ -0,0 +1,19 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/a' + CodeView Record: 4C4570420102030405060708090A0B0C0D0E0F10 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/b' + CodeView Record: 4C4570420A141E28323C46505A646E78828C96A0 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.dmp Binary files differdeleted file mode 100644 index d1a39827b5e..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.yaml new file mode 100644 index 00000000000..e3c170fc335 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-20.yaml @@ -0,0 +1,19 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/a' + CodeView Record: 4C4570420102030405060708090A0B0C0D0E0F1011121314 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/b' + CodeView Record: 4C4570420A141E28323C46505A646E78828C96A0AAB4BEC8 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.dmp Binary files differdeleted file mode 100644 index 238c0f97bf9..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.yaml new file mode 100644 index 00000000000..5bde77efaa7 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-elf-build-id-zero.yaml @@ -0,0 +1,19 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/not/exist/a' + CodeView Record: 4C45704200000000000000000000000000000000 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/not/exist/b' + CodeView Record: 4C45704200000000000000000000000000000000 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.dmp Binary files differdeleted file mode 100644 index 1ce4ce2cffc..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.yaml new file mode 100644 index 00000000000..7b80fd51abd --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-no-age.yaml @@ -0,0 +1,19 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/a' + CodeView Record: 525344530102030405060708090A0B0C0D0E0F100000000000 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/b' + CodeView Record: 525344530A141E28323C46505A646E78828C96A00000000000 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.dmp Binary files differdeleted file mode 100644 index ee82b9bd704..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.yaml new file mode 100644 index 00000000000..083b313254e --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-uuids-with-age.yaml @@ -0,0 +1,19 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: ARM + Platform ID: Linux + CSD Version: '15E216' + CPU: + CPUID: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/a' + CodeView Record: 525344530102030405060708090A0B0C0D0E0F101010101000 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/b' + CodeView Record: 525344530A141E28323C46505A646E78828C96A02020202000 +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.dmp Binary files differdeleted file mode 100644 index d8e1f4a70c9..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.yaml new file mode 100644 index 00000000000..7ca887cdf2c --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/linux-arm-zero-uuids.yaml @@ -0,0 +1,21 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: AMD64 + Platform ID: Linux + CSD Version: '15E216' + CPU: + Vendor ID: GenuineIntel + Version Info: 0x00000000 + Feature Info: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/file/does/not/exist/a' + CodeView Record: '52534453000000000000000000000000000000000000000000' + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/file/does/not/exist/b' + CodeView Record: '52534453000000000000000000000000000000000000000000' +... diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.dmp b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.dmp Binary files differdeleted file mode 100644 index 1cc6e56987a..00000000000 --- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.dmp +++ /dev/null diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.yaml new file mode 100644 index 00000000000..57e291ee1b1 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/macos-arm-uuids-no-age.yaml @@ -0,0 +1,21 @@ +--- !minidump +Streams: + - Type: SystemInfo + Processor Arch: AMD64 + Platform ID: MacOSX + CSD Version: '15E216' + CPU: + Vendor ID: GenuineIntel + Version Info: 0x00000000 + Feature Info: 0x00000000 + - Type: ModuleList + Modules: + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/a' + CodeView Record: 525344530102030405060708090A0B0C0D0E0F100000000000 + - Base of Image: 0x0000000000001000 + Size of Image: 0x00001000 + Module Name: '/tmp/b' + CodeView Record: 525344530A141E28323C46505A646E78828C96A00000000000 +... |