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

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 18 11:16:51 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)
----------------
kastiglione wrote:

to find libc++ via regex, the alternatives regexes are:

1. with `fullpath`: `r"/libc\+\+"`
2. with `basepath`: `r"^libc\+\+"`

so the difference is a bit minor.

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


More information about the lldb-commits mailing list