Skip to content

Commit

Permalink
Dwarfdump test on Windows (#499)
Browse files Browse the repository at this point in the history
  • Loading branch information
sevaa committed Sep 8, 2023
1 parent f0f9981 commit 14e933d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/dwarfdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion test/run_dwarfdump_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
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'

Expand Down

0 comments on commit 14e933d

Please sign in to comment.