[Lldb-commits] [lldb] e724db0 - [lldb/Test] Modify TestSymbolTable.py for reproducers
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue May 26 17:07:47 PDT 2020
Author: Jonas Devlieghere
Date: 2020-05-26T17:07:41-07:00
New Revision: e724db03752a0cd06a86153fea0d95e377f999c0
URL: https://github.com/llvm/llvm-project/commit/e724db03752a0cd06a86153fea0d95e377f999c0
DIFF: https://github.com/llvm/llvm-project/commit/e724db03752a0cd06a86153fea0d95e377f999c0.diff
LOG: [lldb/Test] Modify TestSymbolTable.py for reproducers
Work around global module caching during reproducer replay. See inline
comment for the details.
Added:
Modified:
lldb/test/API/lang/objc/foundation/TestSymbolTable.py
Removed:
################################################################################
diff --git a/lldb/test/API/lang/objc/foundation/TestSymbolTable.py b/lldb/test/API/lang/objc/foundation/TestSymbolTable.py
index df4860f14826..02c551b83876 100644
--- a/lldb/test/API/lang/objc/foundation/TestSymbolTable.py
+++ b/lldb/test/API/lang/objc/foundation/TestSymbolTable.py
@@ -39,7 +39,18 @@ def test_with_python_api(self):
self.assertTrue(process, PROCESS_IS_VALID)
# Create the filespec by which to locate our a.out module.
- filespec = lldb.SBFileSpec(exe, False)
+ #
+ # - Use the absolute path to get the module for the current variant.
+ # - Use the relative path for reproducers. The modules are never
+ # orphaned because the SB objects are leaked intentionally. This
+ # causes LLDB to reuse the same module for every variant, because the
+ # UUID is the same for all the inferiors. FindModule below only
+ # compares paths and is oblivious to the fact that the UUIDs are the
+ # same.
+ if configuration.is_reproducer():
+ filespec = lldb.SBFileSpec('a.out', False)
+ else:
+ filespec = lldb.SBFileSpec(exe, False)
module = target.FindModule(filespec)
self.assertTrue(module, VALID_MODULE)
More information about the lldb-commits
mailing list