mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1236983 - add windbg smarts to mozdebug; r=jmaher,aklotz
This commit is contained in:
parent
0edcbf015f
commit
53f6b89c41
30
testing/mozbase/mozdebug/mozdebug/mozdebug.py
Normal file → Executable file
30
testing/mozbase/mozdebug/mozdebug/mozdebug.py
Normal file → Executable file
@ -50,7 +50,12 @@ _DEBUGGER_INFO = {
|
||||
'wdexpress.exe': {
|
||||
'interactive': True,
|
||||
'args': ['-debugexe']
|
||||
}
|
||||
},
|
||||
|
||||
# Windows Development Kit super-debugger.
|
||||
'windbg.exe': {
|
||||
'interactive': True,
|
||||
},
|
||||
}
|
||||
|
||||
# Maps each OS platform to the preferred debugger programs found in _DEBUGGER_INFO.
|
||||
@ -62,6 +67,19 @@ _DEBUGGER_PRIORITIES = {
|
||||
'unknown': ['gdb']
|
||||
}
|
||||
|
||||
def _windbg_installation_paths():
|
||||
programFilesSuffixes = ['', ' (x86)']
|
||||
programFiles = "C:/Program Files"
|
||||
# Try the most recent versions first.
|
||||
windowsKitsVersions = ['10', '8.1', '8']
|
||||
|
||||
for suffix in programFilesSuffixes:
|
||||
windowsKitsPrefix = os.path.join(programFiles + suffix,
|
||||
'Windows Kits')
|
||||
for version in windowsKitsVersions:
|
||||
yield os.path.join(windowsKitsPrefix, version,
|
||||
'Debuggers', 'x86', 'windbg.exe')
|
||||
|
||||
def get_debugger_info(debugger, debuggerArgs = None, debuggerInteractive = False):
|
||||
'''
|
||||
Get the information about the requested debugger.
|
||||
@ -89,6 +107,16 @@ def get_debugger_info(debugger, debuggerArgs = None, debuggerInteractive = False
|
||||
|
||||
debuggerPath = find_executable(debugger)
|
||||
|
||||
# windbg is not installed with the standard set of tools, and it's
|
||||
# entirely possible that the user hasn't added the install location to
|
||||
# PATH, so we have to be a little more clever than normal to locate it.
|
||||
# Just try to look for it in the standard installed location(s).
|
||||
if not debuggerPath and debugger == 'windbg.exe':
|
||||
for candidate in _windbg_installation_paths():
|
||||
if os.path.exists(candidate):
|
||||
debuggerPath = candidate
|
||||
break
|
||||
|
||||
if not debuggerPath:
|
||||
print 'Error: Could not find debugger %s.' % debugger
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user