[Lldb-commits] [lldb] [lldb] Fix regex support in SBTarget.modules_access (PR #116452)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 18 10:57:02 PST 2024


================
@@ -79,11 +79,11 @@ STRING_EXTENSION_LEVEL_OUTSIDE(SBTarget, lldb::eDescriptionLevelBrief)
                         module = self.sbtarget.GetModuleAtIndex(idx)
                         if module.uuid == key:
                             return module
-                elif type(key) is re.SRE_Pattern:
+                elif isinstance(key, type(re.compile(''))):
                     matching_modules = []
                     for idx in range(num_modules):
                         module = self.sbtarget.GetModuleAtIndex(idx)
-                        re_match = key.search(module.path.fullpath)
+                        re_match = key.search(module.file.fullpath)
----------------
bulbazord wrote:

Does this mean you'd be able to search for modules just by the module's base name instead of the complete path? e.g. You could find libc++ with `libc++` instead of `/usr/lib/libc++.dylib` or whatever.

If so, I'd be supportive of that kind of change.

https://github.com/llvm/llvm-project/pull/116452


More information about the lldb-commits mailing list