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 # Show the concrete types behind nsIFoo
17 # run when using the auto-solib-add trick
25 # run -mail, when using the auto-solib-add trick
33 # Define a "pu" command to display PRUnichar * strings (100 chars max)
34 # Also allows an optional argument for how many chars to print as long as
46 # scratch array with space for 100 chars plus null terminator. Make
47 # sure to not use ' ' as the char so this copy/pastes well.
48 set $scratch = "____________________________________________________________________________________________________"
51 while (*$uni && $i++ < $limit)
53 set $scratch[$scratch_idx++] = *(char*)$uni++
56 set $scratch[$scratch_idx] = '\0'
60 print /x *(short*)$uni++
64 set $scratch[$scratch_idx] = '\0'
69 # Define a "ps" command to display subclasses of nsAC?String. Note that
70 # this assumes strings as of Gecko 1.9 (well, and probably a few
71 # releases before that as well); going back far enough will get you
72 # to string classes that this function doesn't work for.
75 if (sizeof(*$str.mData) == 1 && ($str.mFlags & 1) != 0)
78 pu $str.mData $str.mLength
82 # Define a "pa" command to display the string value for an nsIAtom
85 if (sizeof(*((&*$atom)->mString)) == 2)
90 # define a "pxul" command to display the type of a XUL element from
91 # an nsXULElement* pointer.
94 print $p->mNodeInfo.mRawPtr->mInner.mName->mStaticAtom->mString
97 # define a "prefcnt" command to display the refcount of an XPCOM obj
100 print ((nsPurpleBufferEntry*)$p->mRefCnt.mTagged)->mRefCnt
103 # define a "ptag" command to display the tag name of a content node
106 pa $p->mNodeInfo.mRawPtr->mInner.mName
116 set $size = $arg0.mHdr->mLength
117 set $capacity = $arg0.mHdr->mCapacity
118 set $size_max = $size - 1
119 set $elts = $arg0.Elements()
124 printf "elem[%u]: ", $i
131 if $idx < 0 || $idx > $size_max
132 printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
134 printf "elem[%u]: ", $idx
139 set $start_idx = $arg1
140 set $stop_idx = $arg2
141 if $start_idx > $stop_idx
142 set $tmp_idx = $start_idx
143 set $start_idx = $stop_idx
144 set $stop_idx = $tmp_idx
146 if $start_idx < 0 || $stop_idx < 0 || $start_idx > $size_max || $stop_idx > $size_max
147 printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
150 while $i <= $stop_idx
151 printf "elem[%u]: ", $i
158 printf "nsTArray length = %u\n", $size
159 printf "nsTArray capacity = %u\n", $capacity
166 Prints nsTArray information.
168 Note: idx, idx1 and idx2 must be in acceptable range [0...size()-1].
170 ptarray a - Prints tarray content, size, capacity and T typedef
171 ptarray a 0 - Prints element[idx] from tarray
172 ptarray a 1 2 - Prints elements in range [idx1..idx2] from tarray
180 call $arg0->DumpFrameTree()