Dwarfdump test on Windows (#499)
authorSeva Alekseyev <sevaa@yarxi.ru>
Fri, 8 Sep 2023 15:44:11 +0000 (11:44 -0400)
committerGitHub <noreply@github.com>
Fri, 8 Sep 2023 15:44:11 +0000 (08:44 -0700)
scripts/dwarfdump.py
test/run_dwarfdump_tests.py

index fec7524a806c6851049d780b4f74bdccc9ec6dc9..bf05bdb9e5fe030dc895a98e5657f68b8c0d2bcf 100644 (file)
@@ -14,7 +14,7 @@
 # This code is in the public domain
 #-------------------------------------------------------------------------------
 import argparse
-import os, sys, posixpath
+import os, sys
 import traceback
 
 # For running from development directory. It should take precedence over the
@@ -147,13 +147,13 @@ def _desc_decl_file(attr, die):
         if dir_index >= 0:
             dir = bytes2str(includes[dir_index])
             if dir.startswith('.'):
-                dir = posixpath.join(_cu_comp_dir(cu), dir)
+                dir = os.path.join(_cu_comp_dir(cu), dir)
         else:
             dir = _cu_comp_dir(cu)
         file_name = bytes2str(file_entry.name)
     else:
         raise DWARFError("Invalid source filename entry index in a decl_file attribute")
-    return "\"%s\"" % (posixpath.join(dir, file_name),)
+    return "\"%s\"" % (os.path.join(dir, file_name),)
 
 
 def _desc_ranges(attr, die):
index e9710c237c1d30ea3b9e234cd6dac0b62da7abdb..629db01f3eab076daa67fc3b9e136b673a91937d 100644 (file)
@@ -32,7 +32,8 @@ testlog.addHandler(logging.StreamHandler(sys.stdout))
 if platform.system() == "Darwin": # MacOS
     raise NotImplementedError("Not supported on MacOS")
 elif platform.system() == "Windows":
-    raise NotImplementedError("Not supported on Windows")
+    # Point the environment variable DWARFDUMP at a Windows build of llvm-dwarfdump
+    DWARFDUMP_PATH = os.environ.get('DWARFDUMP', "llvm-dwarfdump.exe")
 else:
     DWARFDUMP_PATH = 'test/external_tools/llvm-dwarfdump'