mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
strip leading white space
This commit is contained in:
committed by
Nikita Smith
parent
81381f9a6d
commit
04d2877b40
@@ -5,7 +5,7 @@ import os
|
|||||||
def get_sorted_objs(pdb_path):
|
def get_sorted_objs(pdb_path):
|
||||||
result = subprocess.run(["llvm-pdbutil", "dump", "--modules", pdb_path], stdout=subprocess.PIPE, text=True)
|
result = subprocess.run(["llvm-pdbutil", "dump", "--modules", pdb_path], stdout=subprocess.PIPE, text=True)
|
||||||
lines = result.stdout.strip().split('\n')
|
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>")
|
# sort by the obj_path portion (line format: "Mod <imod> <obj_path>")
|
||||||
def extract_path(line): return line.split(maxsplit=2)[2].lower()
|
def extract_path(line): return line.split(maxsplit=2)[2].lower()
|
||||||
sorted_lines = sorted(filtered_lines, key=extract_path)
|
sorted_lines = sorted(filtered_lines, key=extract_path)
|
||||||
@@ -13,4 +13,4 @@ def get_sorted_objs(pdb_path):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sorted_objs = get_sorted_objs(sys.argv[1])
|
sorted_objs = get_sorted_objs(sys.argv[1])
|
||||||
for l in sorted_objs: print(l)
|
for l in sorted_objs: print(l.lstrip())
|
||||||
|
|||||||
Reference in New Issue
Block a user