Closed Bug 1522318 Opened 6 years ago Closed 6 years ago

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

Categories

(GeckoView Graveyard :: Sandboxing, enhancement, P3)

Unspecified
Android
enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: agi, Assigned: nalexander)

References

(Blocks 2 open bugs)

Details

Attachments

(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
Status: NEW → ASSIGNED

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 nalexander@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1afc68022e2b Wait for Java debugger when MOZ_DEBUG_{CHILD_}WAIT_FOR_JAVA_DEBUGGER. r=esawin
Status: ASSIGNED → RESOLVED
Closed: 6 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
Product: GeckoView → GeckoView Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: