1 # .gdbinit file for debugging Mozilla
3 # You may need to put an 'add-auto-load-safe-path' command in your
4 # $HOME/.gdbinit file to get GDB to trust this file. If your builds are
5 # generally in $HOME/moz, then you can say:
7 # add-auto-load-safe-path ~/moz
9 # Don't stop for the SIG32/33/etc signals that Flash produces
10 handle SIG32 noprint nostop pass
11 handle SIG33 noprint nostop pass
12 handle SIGPIPE noprint nostop pass
14 # Don't stop for certain other signals where it's not useful,
15 # such as the SIG64 signals triggered by the Linux
16 # sandboxing code on older kernels.
17 handle SIG38 noprint nostop pass
18 handle SIG64 noprint nostop pass
19 handle SIGSYS noprint nostop pass
21 # Show the concrete types behind nsIFoo
24 # run when using the auto-solib-add trick
32 # run -mail, when using the auto-solib-add trick
40 # Define a "pu" command to display PRUnichar * strings (100 chars max)
41 # Also allows an optional argument for how many chars to print as long as
53 # scratch array with space for 100 chars plus null terminator. Make
54 # sure to not use ' ' as the char so this copy/pastes well.
55 set $scratch = "____________________________________________________________________________________________________"
58 while (*$uni && $i++ < $limit)
60 set $scratch[$scratch_idx++] = *(char*)$uni++
63 set $scratch[$scratch_idx] = '\0'
67 print /x *(short*)$uni++
71 set $scratch[$scratch_idx] = '\0'
76 # Define a "ps" command to display subclasses of nsAC?String. Note that
77 # this assumes strings as of Gecko 1.9 (well, and probably a few
78 # releases before that as well); going back far enough will get you
79 # to string classes that this function doesn't work for.
82 if (sizeof(*$str.mData) == 1 && ($str.mFlags & 1) != 0)
85 pu $str.mData $str.mLength
89 # Define a "pa" command to display the string value for an nsAtom
92 if (sizeof(*((&*$atom)->mString)) == 2)
97 # define a "pxul" command to display the type of a XUL element from
98 # an nsXULElement* pointer.
101 print $p->mNodeInfo.mRawPtr->mInner.mName->mStaticAtom->mString
104 # define a "prefcnt" command to display the refcount of an XPCOM obj
107 print ((nsPurpleBufferEntry*)$p->mRefCnt.mTagged)->mRefCnt
110 # define a "ptag" command to display the tag name of a content node
113 pa $p->mNodeInfo.mRawPtr->mInner.mName
123 set $size = $arg0.mHdr->mLength
124 set $capacity = $arg0.mHdr->mCapacity
125 set $size_max = $size - 1
126 set $elts = $arg0.Elements()
131 printf "elem[%u]: ", $i
138 if $idx < 0 || $idx > $size_max
139 printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
141 printf "elem[%u]: ", $idx
146 set $start_idx = $arg1
147 set $stop_idx = $arg2
148 if $start_idx > $stop_idx
149 set $tmp_idx = $start_idx
150 set $start_idx = $stop_idx
151 set $stop_idx = $tmp_idx
153 if $start_idx < 0 || $stop_idx < 0 || $start_idx > $size_max || $stop_idx > $size_max
154 printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
157 while $i <= $stop_idx
158 printf "elem[%u]: ", $i
165 printf "nsTArray length = %u\n", $size
166 printf "nsTArray capacity = %u\n", $capacity
173 Prints nsTArray information.
175 Note: idx, idx1 and idx2 must be in acceptable range [0...size()-1].
177 ptarray a - Prints tarray content, size, capacity and T typedef
178 ptarray a 0 - Prints element[idx] from tarray
179 ptarray a 1 2 - Prints elements in range [idx1..idx2] from tarray
187 call $arg0->DumpFrameTree()
191 call $arg0->DumpFrameTreeInCSSPixels()
195 call $arg0->DumpFrameTreeLimited()
199 call $arg0->DumpFrameTreeLimitedInCSSPixels()
202 source .gdbinit_python