mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
This commit is contained in:
parent
7c33548f6a
commit
7f76c4b284
1 changed files with 11 additions and 6 deletions
|
|
@ -47,29 +47,34 @@ from winappdbg.win32.kernel32 import *
|
|||
def _load_latest_dbghelp_dll():
|
||||
|
||||
from os import getenv
|
||||
from os.path import join
|
||||
from os.path import join, exists
|
||||
|
||||
program_files_location = getenv("ProgramFiles")
|
||||
if not program_files_location:
|
||||
program_files_location = "C:\Program Files"
|
||||
|
||||
program_files_x86_location = getenv("ProgramFiles(x86)")
|
||||
|
||||
if arch == ARCH_AMD64:
|
||||
if wow64:
|
||||
pathname = join(
|
||||
getenv("ProgramFiles(x86)",
|
||||
getenv("ProgramFiles")),
|
||||
program_files_x86_location or program_files_location,
|
||||
"Debugging Tools for Windows (x86)",
|
||||
"dbghelp.dll")
|
||||
else:
|
||||
pathname = join(
|
||||
getenv("ProgramFiles"),
|
||||
program_files_location,
|
||||
"Debugging Tools for Windows (x64)",
|
||||
"dbghelp.dll")
|
||||
elif arch == ARCH_I386:
|
||||
pathname = join(
|
||||
getenv("ProgramFiles"),
|
||||
program_files_location,
|
||||
"Debugging Tools for Windows (x86)",
|
||||
"dbghelp.dll")
|
||||
else:
|
||||
pathname = None
|
||||
|
||||
if pathname:
|
||||
if pathname and exists(pathname):
|
||||
try:
|
||||
_dbghelp = ctypes.windll.LoadLibrary(pathname)
|
||||
ctypes.windll.dbghelp = _dbghelp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue