Open Bug 1261180 Opened 9 years ago Updated 1 month ago

Add --debugger [gdb|lldb|rr|...] flag to marionette runner and mach

Categories

(Testing :: Marionette Client and Harness, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: fitzgen, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: pi-marionette-client)

I am debugging an assertion failure where my only reproducible test case is running marionette tests and this is really annoying to debug with gdb because I have to try to find and attach to the process before it ends. Would be a lot easier if I could add `--debugger gdb` when running marionette tests.
Assignee: nobody → ato
Status: NEW → ASSIGNED
Specifically, a C++ assertion failure unrelated to the marionette tests, which results in crashing the process in DEBUG builds.
Btw this is no only mach which is missing this flag. But also the runner doesn't have it yet.
Summary: Add --debugger [gdb|lldb|rr|...] flag to `./mach marionette-test` → Add --debugger [gdb|lldb|rr|...] flag to marionette runner and mach
Unassigning myself.
Assignee: ato → nobody
Status: ASSIGNED → NEW
Priority: -- → P3
For those looking for a temporary fix, I use a patch[1] that adds MOZ_DEBUG_PARENT_PROCESS (similar to MOZ_DEBUG_CHILD_PROCESS), where gecko dumps the process id and waits for a debugger to attach. [1] https://github.com/brendandahl/gecko/commit/73f78b6b68ebd2520e893ad221c4a34bd2dd1045
Priority: P3 → P1
Priority: P1 → P3
Version: Version 3 → unspecified
Severity: normal → S3
Product: Testing → Remote Protocol
Component: Marionette → Marionette Client and Harness
Product: Remote Protocol → Testing

A workaround for using rr is to rename the firefox binary and place a script in it's place

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
FIREFOX_BIN="${SCRIPT_DIR}/firefox-orig"

if [[ ! -x "$FIREFOX_BIN" ]]; then
  echo "Error: cannot find $FIREFOX_BIN" >&2
  exit 1
fi

exec rr record "$FIREFOX_BIN" "$@"
You need to log in before you can comment on or make changes to this bug.