Closed Bug 1117958 Opened 9 years ago Closed 9 years ago

"mach run" should treat --debugger just like other mach commands

Categories

(Firefox Build System :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(firefox41 fixed)

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: mccr8, Assigned: kats)

References

Details

Attachments

(1 file)

When I try to use mach run to run Firefox with the debugger, it just seems to run it without the debugger.

$ ./mach run --debugger lldb 
 0:00.36 /Users/amccreight/mc/obj-dbg.noindex/dist/NightlyDebug.app/Contents/MacOS/firefox -no-remote -foreground -profile /Users/amccreight/mc/obj-dbg.noindex/tmp/scratch_user

Note that if I omit the "lldb" it complains that debugger is missing an argument, so there's something happening.  This is on OSX.
You may try this command
./mach run --debug --debugger lldb
https://dxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/mach_commands.py#943

In current design logic, --debugger argument will be respected only if --debug arguement exists.
Ok, I noticed that command line help string reveal this dependency:
$ ./mach run -h

Command Arguments for debugging:
  --debug               Enable the debugger. Not specifying a --debugger
                        option will result in the default debugger being used.
                        The following arguments have no effect without this. <<<<<<
  --debugger DEBUGGER   Name of debugger to use.
(In reply to C.J. Ku[:cjku] from comment #2)
> In current design logic, --debugger argument will be respected only if
> --debug arguement exists.

Seems like we could fix this by just making that
if debug or debugger:

...so that --debugger implies --debug.
if debug or debugger or debugparams
Alternative, we may output an error message, tell user "--debugger/debugparams" depends on "--debug".
The summary from dbaron's bug is better.
Summary: mach run doesn't work with --debugger → "mach run" should treat --debugger just like other mach commands
According to mach file-info bugzilla-component python/mozbuild/mozbuild/mach_commands.py this belongs in Build Config.
Component: mach → Build Config
Attached patch PatchSplinter Review
Attachment #8608922 - Flags: review?(gps)
Comment on attachment 8608922 [details] [diff] [review]
Patch

Review of attachment 8608922 [details] [diff] [review]:
-----------------------------------------------------------------

Clear UX win. Great enhancement.
Attachment #8608922 - Flags: review?(gps) → review+
Assignee: nobody → bugmail.mozilla
https://hg.mozilla.org/mozilla-central/rev/8b94f0b47183
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: