Open Bug 1231725 Opened 4 years ago Updated 4 years ago

Make it possible to debug xpcshell tests with xcode

Categories

(Testing :: XPCShell Harness, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: mossop, Unassigned)

Details

It currently seems to be impossible to do this and we have to fall back to using lldb command line to debug in xpcshell which is pretty painful. Engineers would be more productive if we could use Xcode instead.
Is this something we could get someone to work on?
Flags: needinfo?(jgriffin)
When you asked this in IRC I looked into it briefly and I don't think there's a simple way to support this because there's no way to ask xcode to launch a debugger from the command line that I could find. Also, you need an xcode project to run the xcode debugger (AIUI), so we'd have to first generate an xcode project.

Making this work would involve something like:
1) Generate an xcode project
2) Somewhere in xcode configuration, write the xpcshell commandline we want to execute from the xpcshell harness but don't actually launch it.
3) Tell the developer to do something in xcode to launch the debugger with those arguments.

If there's some simpler way to make this happen that would be great.
We used to have a way to start the xpcshell test but pause before actually calling the test function, then you could attach any debugger and then run the test function manually. That seems to have been lost somewhere along the way and now mach requires a specific debugger on the command line which as you say can't work with xpcshell.

If we could just restore that old behaviour things would be a lot easier.
(In reply to Dave Townsend [:mossop] from comment #3)
> We used to have a way to start the xpcshell test but pause before actually
> calling the test function, then you could attach any debugger and then run
> the test function manually. That seems to have been lost somewhere along the
> way and now mach requires a specific debugger on the command line which as
> you say can't work with xpcshell.
> 
> If we could just restore that old behaviour things would be a lot easier.

This seems like it would be easy to add; cc'ing a few people to see if someone has bandwidth to pick this up.
Flags: needinfo?(jgriffin)
You need to log in before you can comment on or make changes to this bug.