[Lldb-commits] [lldb] [lldb] Initial plugin and test for SymbolLocatorSymStore (PR #183302)

Stefan Gränitz via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 4 11:03:31 PST 2026


================
@@ -0,0 +1,113 @@
+import glob
+import os
+import shutil
+import tempfile
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+
+"""
+Test debug symbol acquisition from a local SymStore repository.
+"""
+
+
+class MockedSymStore:
+    """
+    Populate a file structure equivalent to SymStore.exe in a temporary directory.
+    This can work cross-platform and for arbitrary debug info formats. Right now,
+    we support only PDB.
+    """
+
+    def __init__(self, test, exe, pdb):
+        self._test = test
+        self._exe = exe
+        self._pdb = pdb
+        self._tmp = None
+
+    def get_key_pdb(self, exe):
+        """
+        Module UUID: 12345678-1234-5678-9ABC-DEF012345678-00000001
+        To SymStore key: 12345678123456789ABCDEF0123456781
+        """
+        try:
+            spec = lldb.SBModuleSpec()
+            spec.SetFileSpec(lldb.SBFileSpec(self._test.getBuildArtifact(exe)))
+            module = lldb.SBModule(spec)
+            raw = module.GetUUIDString().replace("-", "").upper()
+            if len(raw) != 40:
+                return None
+            guid_hex = raw[:32]
+            age = int(raw[32:], 16)
+            return guid_hex + str(age)
+        except Exception:
----------------
weliveindetail wrote:

Done

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


More information about the lldb-commits mailing list