gdb prettyprinters not loaded if running from wrong directory
Categories
(Developer Infrastructure :: Developer Environment Integration, defect, P3)
Tracking
(firefox79 fixed)
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: sfink, Assigned: sfink)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
I started on this because I wanted JS pretty-printers in Pernosco. It scope-crept.
I wrote this patch to address two problems:
- if I do
mach run
from a directory other than $topsrcdir, $objdir, or
$objdir/dist/bin, then .gdbinit will not be loaded. - Debugging the firefox binary will never load the JS prettyprinters in any
case.
I believe this patch fixes other problems as well, such as .gdbinit_python not being found, and the gdbpp pretty-printers not getting loaded in various situations.
The main changes of this patch are:
- Move .gdbinit into build/ (and $objdir/build/) to delay it from getting
loaded until the search path is configured. - Move libxul.so-gdb.py into the correct directory.
- Use either libxul.so-gdb.py or js-gdb.py to configure the correct
search path then load .gdbinit, and have .gdbinit load all of the
pretty-printers (Gecko and JS). - Use a single preprocessed file to configure the source directory. Use
relative paths within the objdir for everything else.
Note that this still hardcodes the name "libxul.so" rather than using the platform-specific name. I figured this was fine because gdb is really only functional on Linux anyway. This limitation is pre-existing.
Assignee | ||
Comment 1•3 years ago
•
|
||
(removed redundant comment)
Note that there is a Rust debugging script gdb_load_rust_pretty_printers.py
that is stored in the .debug_gdb_scripts
section that will still not be found after this patch. I didn't try to tackle that. (That script looks like it ships with rustc, but nothing adds that directory to the search path. Maybe it does with a Rust main binary?)
Assignee | ||
Updated•3 years ago
|
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/df0d6b993ad6 Remove directory dependence of GDB init files. r=nalexander
Comment 3•3 years ago
|
||
Backed out changeset df0d6b993ad6 (Bug 1642121) for causing build bustages
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=306334366&repo=autoland&lineNumber=455
Backout: https://hg.mozilla.org/integration/autoland/rev/995cb36e46d49d74ec262dc7d85b4fb3497cd8f0
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d8ee4696e13 Remove directory dependence of GDB init files. r=nalexander
Comment 5•3 years ago
|
||
bugherder |
Updated•8 months ago
|
Description
•