Closed Bug 1522318 Opened 4 years ago Closed 4 years ago

Add a way to wait to debug child processes' native code


(GeckoView :: Sandboxing, enhancement, P3)



(firefox68 fixed)

Tracking Status
firefox68 --- fixed


(Reporter: agi, Assigned: nalexander)


(Blocks 2 open bugs)



(1 file)

We need a way to wait for the debugger for child processes, similar to MOZ_DEBUG_CHILD_PROCESS for desktop.

agi: snorp pointed you at try MOZ_DEBUG_CHILD_PROCESS=1 and MOZ_DEBUG_CHILD_PAUSE=10. Can you test, capture this somewhere (in the GeckoView wiki -- I don't know anywhere better), and if you're satisfied close this ticket?

If it's easy we could support this in mach run while we're trying to improve that functionality: Bug 1521996.

Flags: needinfo?(agi)

P3. This is necessary for debugging content process crashes on startup.

OS: All → Android
Priority: -- → P3
See Also: → 1521996

OK looks like MOZ_DEBUG_CHILD_PAUSE works somewhat, but we can do better. I think we should add a flag similar to MOZ_DEBUG_CHILD_PROCESS that makes us wait for the debugger (right now the code just continues) something like MOZ_DEBUG_WAIT_FOR_JAVA_DEBUGGER.

Flags: needinfo?(agi)
Assignee: nobody → nalexander

Set MOZ_DEBUG_WAIT_FOR_JAVA_DEBUGGER=1 in the environment to make the
main (Gecko) process wait for a Java debugger to connect. This is a
superset of Android Studio's built-in debugging support so it won't be
particularly useful, but perhaps some folks want to use a different
jdwp debugger.

Set MOZ_DEBUG_CHILD_WAIT_FOR_JAVA_DEBUGGER=filter in the environment
to make child processes wait for a Java debugger to connect. This is
not easy in Android Studio.

Valid filter values are:

  • "1" to make all child processes (:tab, :media, etc) wait
  • "suffix" to make any child process with a process name with suffix "suffix" wait

N.b.: the empty string "" is a suffix of all process names and thus
MOZ_DEBUG_CHILD_WAIT_FOR_JAVA_DEBUGGER= makes all child processes wait.

Attachment #9054327 - Attachment description: Bug 1522318 - Wait for Java debugger when MOZ_DEBUG_{CHILD_}WAIT_FOR_JAVA_DEBUGGER. r?#geckoview-reviewers → Bug 1522318 - Wait for Java debugger when MOZ_DEBUG_{CHILD_}WAIT_FOR_JAVA_DEBUGGER. r?esawin
Pushed by
Wait for Java debugger when MOZ_DEBUG_{CHILD_}WAIT_FOR_JAVA_DEBUGGER. r=esawin
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Blocks: 1548876
See Also: → 1698174

Moving content process bugs to the new GeckoView::Sandboxing component.

Component: General → Sandboxing
You need to log in before you can comment on or make changes to this bug.