strip leading white space

This commit is contained in:
Nikita Smith
2025-08-15 12:57:33 -07:00
committed by Nikita Smith
parent 81381f9a6d
commit 04d2877b40
+2 -2
View File
@@ -5,7 +5,7 @@ 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 ")]
filtered_lines = [line for line in lines if line.lstrip().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)
@@ -13,4 +13,4 @@ def get_sorted_objs(pdb_path):
if __name__ == "__main__":
sorted_objs = get_sorted_objs(sys.argv[1])
for l in sorted_objs: print(l)
for l in sorted_objs: print(l.lstrip())