Closed Bug 1092217 Opened 10 years ago Closed 9 years ago

Allow debugging gtests via mach

Categories

(Firefox Build System :: Mach Core, enhancement)

x86
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(1 file, 1 obsolete file)

Running gtests under a debugger is kind of a pain since there's all these hidden env variables and stuff that happens under the hood when you run |mach gtest|. I would like to add a --debug option to the gtest command so that it automatically runs the exact same thing but under the debugger.
Attached patch Patch (obsolete) — Splinter Review
Attachment #8515068 - Flags: review?(gps)
Comment on attachment 8515068 [details] [diff] [review]
Patch

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

Someone else needs to review the mozdebug patch, as I'm not a peer there. You'd have to look at commit history to see who a peer is.
Attachment #8515068 - Flags: review?(gps)
Comment on attachment 8515068 [details] [diff] [review]
Patch

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

Sorry for the review delay.

I think we should drop the mozdebug part of this patch and just leave that junk in the gtest command for now. I hate everything about the gtest mach command, it needs to die and just call into rungtests.py. At that point we can just pass the debug_args right into mozrunner which is what all the other harnesses do.

::: python/mozbuild/mozbuild/mach_commands.py
@@ +653,5 @@
> +    @CommandArgument('--debug', action='store_true', group='debugging',
> +        help='Enable the debugger. Not specifying a --debugger option will result in the default debugger being used. The following arguments have no effect without this.')
> +    @CommandArgument('--debugger', default=None, type=str, group='debugging',
> +        help='Name of debugger to use.')
> +    @CommandArgument('--debugparams', default=None, metavar='params', type=str,

This sucks, in that all the other test harnesses call it --debugger-args:
http://dxr.mozilla.org/mozilla-central/source/layout/tools/reftest/mach_commands.py#305
http://dxr.mozilla.org/mozilla-central/source/testing/mochitest/mach_commands.py#416

...but I guess mach run calls it debugparams? I'd go with consistency with the other testing commands for now, maybe we can change mach run to match even though breaking people's expectations sucks.
Attachment #8515068 - Flags: review?(ted) → review-
Attached patch Patch v2Splinter Review
Attachment #8515068 - Attachment is obsolete: true
Attachment #8527224 - Flags: review?(ted)
Comment on attachment 8527224 [details] [diff] [review]
Patch v2

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

Thanks!
Attachment #8527224 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/9a00da370939
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.