Closed Bug 1517811 Opened 2 years ago Closed 2 years ago
`mach run --debugger=windbg
.exe` doesn't work if windbg isn't in PATH
47 bytes, text/x-phabricator-request
|Details | Review|
`mach run` uses mozdebug to locate debuggers: https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/python/mozbuild/mozbuild/mach_commands.py#984-1008 mozdebug has code to locate windbg even if it's not in PATH: https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/testing/mozbase/mozdebug/mozdebug/mozdebug.py#165-177 This code works fine on my system: $ ./mach python Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import mozdebug >>> mozdebug.get_debugger_info('windbg.exe') DebuggerInfo(path='C:/Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\windbg.exe', interactive=True, args=, requiresEscapedArgs=False) However, we error out before trying that because of this check in mach's main.py: https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/python/mach/mach/main.py#454-480 $ ./mach run --debugger=windbg.exe Specified debugger 'windbg.exe' is not found. Is it installed? Is it in your PATH? It feels like we shouldn't shoot ourselves in the foot here. Maybe mach should be using `mozdebug.get_debugger_info` instead of just `which`, since all of our test harnesses etc are likely using mozdebug anyway?
Additionally this doesn't even work if you pass an absolute path to the debugger, because `which.which` doesn't work with absolute paths. :-/ $ ./mach run --debugger='C:/Program Files (x86)/Windows Kits/10/Debuggers/x64/windbg.exe' Specified debugger 'C:/Program Files (x86)/Windows Kits/10/Debuggers/x64/windbg.exe' is not found. Is it installed? Is it in your PATH?
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/e08a0bb35c03 use mozdebug in mach to validate debugger arguments. r=froydnj
You need to log in before you can comment on or make changes to this bug.