diff options
author | Pavel Labath <pavel@labath.sk> | 2019-05-10 15:05:26 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-05-10 15:05:26 +0000 |
commit | 78c1dcb7b7e1436232fc0dab778d9849f8aa5609 (patch) | |
tree | 587e6fd3d2272730a7e96c610b9ad13e7dd933f2 /lldb/packages/Python/lldbsuite/test/functionalities | |
parent | b284414a1bf1be379cd28c8a10075f0d5238d18d (diff) | |
download | bcm5719-llvm-78c1dcb7b7e1436232fc0dab778d9849f8aa5609.tar.gz bcm5719-llvm-78c1dcb7b7e1436232fc0dab778d9849f8aa5609.zip |
minidump: Don't eagerly resolve module paths read from the minidump
This can cause us to return paths to files on the local filesystem even
if we don't end up using that file (for instance because the file is not
a real module).
llvm-svn: 360432
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities')
2 files changed, 29 insertions, 1 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 8a69d1cadb6..b0e9f1dff22 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 @@ -34,7 +34,7 @@ class MiniDumpUUIDTestCase(TestBase): self.assertEqual(verify_uuid, uuid) def get_minidump_modules(self, yaml_file): - minidump_path = self.getBuildArtifact(yaml_file + ".dmp") + minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp") self.yaml2obj(yaml_file, minidump_path) self.target = self.dbg.CreateTarget(None) self.process = self.target.LoadCore(minidump_path) @@ -166,3 +166,14 @@ class MiniDumpUUIDTestCase(TestBase): self.verify_module(modules[0], "/invalid/path/on/current/system/libuuidmismatch.so", "7295E17C-6668-9E05-CBB5-DEE5003865D5") + + def test_relative_module_name(self): + old_cwd = os.getcwd() + self.addTearDownHook(lambda: os.chdir(old_cwd)) + os.chdir(self.getBuildDir()) + name = "file-with-a-name-unlikely-to-exist-in-the-current-directory.so" + open(name, "a").close() + modules = self.get_minidump_modules( + self.getSourcePath("relative_module_name.yaml")) + self.assertEqual(1, len(modules)) + self.verify_module(modules[0], name, None) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/relative_module_name.yaml b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/relative_module_name.yaml new file mode 100644 index 00000000000..23f2b490280 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/relative_module_name.yaml @@ -0,0 +1,17 @@ +--- !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-with-a-name-unlikely-to-exist-in-the-current-directory.so' + CodeView Record: '' +... |