Closed Bug 1517811 Opened 8 months ago Closed 8 months ago

`mach run --debugger=windbg.exe` doesn't work if windbg isn't in PATH


(Firefox Build System :: Mach Core, enhancement)

Not set


(firefox66 fixed)

Tracking Status
firefox66 --- fixed


(Reporter: ted, Assigned: ted)




(1 file)

`mach run` uses mozdebug to locate debuggers:

mozdebug has code to locate windbg even if it's not in PATH:

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

$ ./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?
See Also: → 1517793
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?

Will be monitoring this bug, and possibly take it if I have some bandwidth..

I wrote a simple local patch to use mozdebug which made this work for me. I'll get it up for review.

Assignee: nobody → ted
Pushed by
use mozdebug in mach to validate debugger arguments. r=froydnj
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.