Closed
Bug 941539
Opened 11 years ago
Closed 11 years ago
Add a .lldbinit file to the tree and make the build system install it to $(DIST)/bin
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla28
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file)
1.74 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
Xcode 5 now only comes with lldb (gdb is history), so increasing numbers of users are going to be using it (even if unknowingly, since that's what Xcode will now force projects to use "under the hood"). Unfortunately, with the recent addition of UNIFIED_SOURCES lldb breakpoints will not, by default, work in source files that are built using UNIFIED_SOURCES. See:
https://groups.google.com/d/msg/mozilla.dev.platform/WjcCfckml4A/d1Zpl4Qt-uQJ
There is a workaround described here:
http://lldb.llvm.org/troubleshooting.html
although that only seems to work after a certain amount of rebuilding (possibly a clobber) and restarting Xcode:
https://groups.google.com/d/msg/mozilla.dev.platform/WjcCfckml4A/QPtY4b9tN3UJ
I've updated these docs to put a big warning notice at the top:
https://developer.mozilla.org/en/docs/Debugging_on_Mac_OS_X
https://developer.mozilla.org/en-US/docs/Debugging_Mozilla_with_lldb
but probably most existing Mozilla devs won't notice that until they've already wasted time and got frustrated with Xcode/lldb for not stopping at breakpoints in some files. To minimize the amount of dev time that is wasted we should get a default .lldbinit into the tree as soon as possible, and also make sure that the build system installs it into $(DIST)/bin for those users that launch their debug sessions from there instead of from $(topsrcdir).
Comment 1•11 years ago
|
||
The in-tree gdbinit file is handled here:
http://mxr.mozilla.org/mozilla-central/source/build/Makefile.in#72
and lives in $topsrcdir:
http://mxr.mozilla.org/mozilla-central/source/.gdbinit
![]() |
Assignee | |
Comment 2•11 years ago
|
||
Indeed. For the moment I'm trying to figure out why Xcode isn't using this, but I think that's an Xcode issue rather than this patch being wrong so here you go.
Attachment #8335995 -
Flags: review?(ted)
![]() |
Assignee | |
Comment 3•11 years ago
|
||
Regarding getting this working, here are some points of note:
The man page says "Third, an .lldbinit file in the current working directory (where lldb is started) will be read."
http://www.manpagez.com/man/1/lldb/
If you start lldb from the command line from the topsrcdir or from the bin directory then this patch works.
I've not yet figured out how to get Xcode to use the .lldbinit file in this patch though. I've tried setting the absolute path to the topsrcdir in "Use Custom Working Directory" in the "Options" in the "Run" panel under "Project" > "Scheme" > "Edit Scheme...". That doesn't seem to work though because if I start a debugging session with Xcode, pause, and type:
(lldb) script import os; print os.getcwd()
it simply prints "/" which seems to indicate that the path set for "Use Custom Working Directory" is being ignored in Xcode 5.0.1.
I also tried putting the .lldbinit in the root directory, but the lldb started by Xcode is still not picking it up. :/
Comment 4•11 years ago
|
||
Comment on attachment 8335995 [details] [diff] [review]
patch
Review of attachment 8335995 [details] [diff] [review]:
-----------------------------------------------------------------
::: build/Makefile.in
@@ +82,5 @@
> +# NOTE: Keep .lldbinit in the topsrcdir for people who run LLDB from the
> +# topsrcdir rather than the bin directory.
> +LLDBINIT_FILES := $(topsrcdir)/.lldbinit
> +LLDBINIT_DEST = $(FINAL_TARGET)
> +INSTALL_TARGETS += LLDBINIT
nit: you've got lots of trailing whitespace on these lines, please clean it up.
Also, you could just combine this with the GDBINIT stuff above if you wanted to be less verbose.
Attachment #8335995 -
Flags: review?(ted) → review+
![]() |
Assignee | |
Comment 5•11 years ago
|
||
Meh. Dunno why copying and pasting in vim (using Terminal's C&P) leaves all that blank white space. Anyway, I removed it and pushed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8aaed2b88538
I didn't bother combining since that looked to introduce non-zero risk to build failure and I have more pressing things to attend to right now than Try pushes for something like that.
![]() |
Assignee | |
Comment 6•11 years ago
|
||
Regarding the issues of Xcode not picking up the in-tree .lldbinit, I span that issue off into bug 942133.
Comment 7•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•