Closed Bug 1517793 Opened 5 years ago Closed 5 years ago

`mach run --debug` fails with an exception on Windows

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement
Not set
normal

Tracking

(firefox66 fixed)

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: ted, Assigned: ted)

References

Details

Attachments

(1 file)

$ ./mach run --debug
Error running mach:

    ['run', '--debug']

The error occurred in the implementation of the invoked mach command.

This should never occur and is likely a bug in the implementation of that
command. Consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

AttributeError: 'RunProgram' object has no attribute 'debuggerInfo'

  File "c:\build\mozilla-central\python/mozbuild/mozbuild/mach_commands.py", line 1008, in run
    args = [self.debuggerInfo.path] + self.debuggerInfo.args + args

Since I didn't explicitly pass a debugger in the args we call `mozdebug.get_default_debugger_name`:
https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/python/mozbuild/mozbuild/mach_commands.py#988

...but it seems to be returning `None` for me, so then we get down to this block and `self.debuggerInfo` never gets set so this exception gets raised:
https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/python/mozbuild/mozbuild/mach_commands.py#1008

The right fix here would probably be to just pull this check+error up a level and error if `debugger None` or `debuggerInfo is None`:
https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/python/mozbuild/mozbuild/mach_commands.py#992

I'll file another bug on mozdebug, I think it should be able to locate WinDBG / Visual Studio even if they're not in PATH.
See Also: → 1517806
See Also: → 1517811
Assignee: nobody → ted
This change simply moves a check for the "no debugger found" situation out
of a conditional so it will catch more cases.
Pushed by tmielczarek@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7e9a290c0e91
fix `mach run --debug` to not hit an exception if no debugger can be found. r=nalexander
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: