From ba97fdab3aca9d6bc88fb5d3ed2b8d311f61a744 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Sun, 18 Jun 2023 17:09:54 -0700 Subject: [PATCH] make wine path function --- tools/reccomp/reccomp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/reccomp/reccomp.py b/tools/reccomp/reccomp.py index ca535a05..7a4c5e9e 100755 --- a/tools/reccomp/reccomp.py +++ b/tools/reccomp/reccomp.py @@ -88,6 +88,9 @@ class RecompiledInfo: def get_recompiled_address(filename, line): global line_dump, sym_dump + def get_wine_path(fn): + return subprocess.check_output(['winepath', '-w', fn]).decode('utf-8').strip() + # Load source lines from PDB if not line_dump: call = ['cvdump', '-l', '-s'] @@ -95,7 +98,7 @@ def get_recompiled_address(filename, line): if os.name != 'nt': # Run cvdump through wine and convert path to Windows-friendly wine path call.insert(0, 'wine') - call.append(subprocess.check_output(['winepath', '-w', syms]).strip()) + call.append(get_wine_path(syms)) else: call.append(syms) @@ -104,7 +107,7 @@ def get_recompiled_address(filename, line): # Find requested filename/line in PDB if os.name != 'nt': # Convert filename to Wine path - filename = subprocess.check_output(['winepath', '-w', filename]).decode('utf-8').strip() + filename = get_wine_path(filename) #print('Looking for ' + filename + ' line ' + str(line))