helper script for extracting obj paths out of pdb

This commit is contained in:
Nikita Smith
2025-07-24 17:44:02 -07:00
parent 54fad8a89c
commit 6fda20ec9c
+16
View File
@@ -0,0 +1,16 @@
import subprocess
import sys
import os
def get_sorted_objs(pdb_path):
result = subprocess.run(["llvm-pdbutil", "dump", "--modules", pdb_path], stdout=subprocess.PIPE, text=True)
lines = result.stdout.strip().split('\n')
filtered_lines = [line for line in lines if line.startswith("Mod ")]
# sort by the obj_path portion (line format: "Mod <imod> <obj_path>")
def extract_path(line): return line.split(maxsplit=2)[2].lower()
sorted_lines = sorted(filtered_lines, key=extract_path)
return sorted_lines
if __name__ == "__main__":
sorted_objs = get_sorted_objs(sys.argv[1])
for l in sorted_objs: print(l)