Skip to content

Commit

Permalink
Bug 960300 - Put a .lldbinit in the objdir and in dist/bin/, which lo…
Browse files Browse the repository at this point in the history
…ad the .lldbinit in topsrcdir. r=glandium
  • Loading branch information
heycam committed Jan 21, 2014
1 parent d126476 commit 4cc6f40
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
11 changes: 6 additions & 5 deletions .lldbinit
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
# and in the accompanying Python scripts, see python/lldbutils/README.txt.
# -----------------------------------------------------------------------------

# Import the module that defines complex Gecko debugging commands. This assumes
# you are either running lldb from the top level source directory, the objdir,
# or the dist/bin directory. (.lldbinit files in the objdir and dist/bin set
# topsrcdir appropriately.)
script topsrcdir = topsrcdir if locals().has_key("topsrcdir") else "."; sys.path.append(os.path.join(topsrcdir, "python/lldbutils")); import lldbutils; lldbutils.init()

# Mozilla's use of UNIFIED_SOURCES to include multiple source files into a
# single compiled file breaks lldb breakpoint setting. This works around that.
# See http://lldb.llvm.org/troubleshooting.html for more info.
Expand All @@ -15,11 +21,6 @@ settings set target.inline-breakpoint-strategy always
# object as being of type "nsBlockFrame *" rather than "nsIFrame *".
settings set target.prefer-dynamic-value run-target

# Import the module that defines complex Gecko debugging commands. Rather
# than do any kind of searching, this assumes that you are running lldb from
# the top level source directory.
script sys.path.append('python/lldbutils'); import lldbutils; lldbutils.init()

# Show the string value in atoms.
type summary add nsIAtom --summary-string "${var.mString}"

Expand Down
2 changes: 2 additions & 0 deletions build/.lldbinit.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#filter substitution
script topsrcdir = "@topsrcdir@"; lldb.debugger.HandleCommand("command source -s true '%s'" % os.path.join(topsrcdir, ".lldbinit"))
20 changes: 12 additions & 8 deletions build/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,18 @@ GDBINIT_FILES := $(topsrcdir)/.gdbinit
GDBINIT_DEST = $(FINAL_TARGET)
INSTALL_TARGETS += GDBINIT

# Put a useful .lldbinit in the bin directory, to be picked up automatically
# by LLDB when we debug executables using that directory as the current working
# directory.
# 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
# Put a .lldbinit in the bin directory and the objdir, to be picked up
# automatically by LLDB when we debug executables using either of those two
# directories as the current working directory. The .lldbinit file will
# load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
LLDBINIT_OBJDIR := .lldbinit.in
LLDBINIT_OBJDIR_PATH = $(DEPTH)
LLDBINIT_OBJDIR_FLAGS += -Dtopsrcdir=$(abspath $(topsrcdir))
PP_TARGETS += LLDBINIT_OBJDIR

LLDBINIT_FINAL_TARGET_FILES := $(DEPTH)/.lldbinit
LLDBINIT_FINAL_TARGET_DEST = $(FINAL_TARGET)
INSTALL_TARGETS += LLDBINIT_FINAL_TARGET

include $(topsrcdir)/config/rules.mk

Expand Down

0 comments on commit 4cc6f40

Please sign in to comment.