Permalink
Switch branches/tags
last-mozilla-central chromium-import-r15462 chromium-import-latest bsmedberg-static-xpcom-registration-base UPDATE_PACKAGING_R15 UPDATE_PACKAGING_R14 UPDATE_PACKAGING_R13 UPDATE_PACKAGING_R12 UPDATE_PACKAGING_R11_1_MU UPDATE_PACKAGING_R11 UPDATE_PACKAGING_R10 UPDATE_PACKAGING_R9 UPDATE_PACKAGING_R8 UPDATE_PACKAGING_R7 UPDATE_PACKAGING_R6 UPDATE_PACKAGING_R5 THUNDERBIRD_3_3a3_RELEASE THUNDERBIRD_3_3a3_BUILD1 THUNDERBIRD_3_3a2_RELEASE THUNDERBIRD_3_3a2_BUILD1 THUNDERBIRD_3_3a1_RELEASE THUNDERBIRD_3_3a1_BUILD1 SEAMONKEY_2_1b2_RELEASE SEAMONKEY_2_1b2_BUILD2 SEAMONKEY_2_1b2_BUILD1 SEAMONKEY_2_1b1_RELEASE SEAMONKEY_2_1b1_BUILD2 SEAMONKEY_2_1b1_BUILD1 SEAMONKEY_2_1a3_RELEASE SEAMONKEY_2_1a3_BUILD2 SEAMONKEY_2_1a3_BUILD1 SEAMONKEY_2_1a2_RELEASE SEAMONKEY_2_1a2_BUILD2 SEAMONKEY_2_1a2_BUILD1 SEAMONKEY_2_1a1_RELEASE SEAMONKEY_2_1a1_BUILD1 SEAMONKEY_2_0a1_RELEASE SEAMONKEY_2_0a1_BUILD1 PRE_MOBILE_MERGE_20110406 PRE_MOBILE_MERGE MOZILLA_1_9_a7_BASE MOZILLA_1_9_a6_BASE MOZILLA_1_9_a4_BASE GECKO_2_1_BASE GECKO_2_0_BASE GECKO_1_9_2_BASE GECKO_1_9_1_BASE FIREFOX_4_0b12_RELEASE FIREFOX_4_0b12_BUILD1 FIREFOX_4_0b11_RELEASE FIREFOX_4_0b11_BUILD3 FIREFOX_4_0b11_BUILD2 FIREFOX_4_0b11_BUILD1 FIREFOX_4_0b10_RELEASE FIREFOX_4_0b10_BUILD1 FIREFOX_4_0b9_RELEASE FIREFOX_4_0b9_BUILD1 FIREFOX_4_0b8_RELEASE FIREFOX_4_0b8_BUILD1 FIREFOX_4_0b7_RELEASE FIREFOX_4_0b7_BUILD1 FIREFOX_4_0b6_RELEASE FIREFOX_4_0b6_BUILD2 FIREFOX_4_0b6_BUILD1 FIREFOX_4_0b5_RELEASE FIREFOX_4_0b5_BUILD1 FIREFOX_4_0b4_RELEASE FIREFOX_4_0b4_BUILD3 FIREFOX_4_0b4_BUILD2 FIREFOX_4_0b4_BUILD1 FIREFOX_4_0b3_RELEASE FIREFOX_4_0b3_BUILD3 FIREFOX_4_0b3_BUILD2 FIREFOX_4_0b3_BUILD1 FIREFOX_4_0b2_RELEASE FIREFOX_4_0b2_BUILD1 FIREFOX_4_0b1_RELEASE FIREFOX_4_0b1_BUILD2 FIREFOX_4_0b1_BUILD1 FIREFOX_3_7a5_RELEASE FIREFOX_3_7a5_BUILD1 FIREFOX_3_7a4_RELEASE FIREFOX_3_7a4_BUILD1 FIREFOX_3_7a3_RELEASE FIREFOX_3_7a3_BUILD1 FIREFOX_3_7a2_RELEASE FIREFOX_3_7a2_BUILD1 FIREFOX_3_7a1_RELEASE FIREFOX_3_7a1_BUILD1 FIREFOX_3_6a1_RELEASE FIREFOX_3_6a1_BUILD1 FIREFOX_3_1b2_RELEASE FIREFOX_3_1b2_BUILD2 FIREFOX_3_1b2_BUILD1 FIREFOX_3_1b1_RELEASE FIREFOX_3_1b1_BUILD1 FIREFOX_3_1a2_RELEASE FIREFOX_3_1a2_BUILD1 FIREFOX_3_1a1_RELEASE FIREFOX_3_1a1_BUILD2
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
176 lines (161 sloc) 4.71 KB
# .gdbinit file for debugging Mozilla
# Don't stop for the SIG32/33/etc signals that Flash produces
handle SIG32 noprint nostop pass
handle SIG33 noprint nostop pass
handle SIGPIPE noprint nostop pass
# Show the concrete types behind nsIFoo
set print object on
# run when using the auto-solib-add trick
def prun
tbreak main
run
set auto-solib-add 0
cont
end
# run -mail, when using the auto-solib-add trick
def pmail
tbreak main
run -mail
set auto-solib-add 0
cont
end
# Define a "pu" command to display PRUnichar * strings (100 chars max)
# Also allows an optional argument for how many chars to print as long as
# it's less than 100.
def pu
set $uni = $arg0
if $argc == 2
set $limit = $arg1
if $limit > 100
set $limit = 100
end
else
set $limit = 100
end
# scratch array with space for 100 chars plus null terminator. Make
# sure to not use ' ' as the char so this copy/pastes well.
set $scratch = "____________________________________________________________________________________________________"
set $i = 0
set $scratch_idx = 0
while (*$uni && $i++ < $limit)
if (*$uni < 0x80)
set $scratch[$scratch_idx++] = *(char*)$uni++
else
if ($scratch_idx > 0)
set $scratch[$scratch_idx] = '\0'
print $scratch
set $scratch_idx = 0
end
print /x *(short*)$uni++
end
end
if ($scratch_idx > 0)
set $scratch[$scratch_idx] = '\0'
print $scratch
end
end
# Define a "ps" command to display subclasses of nsAC?String. Note that
# this assumes strings as of Gecko 1.9 (well, and probably a few
# releases before that as well); going back far enough will get you
# to string classes that this function doesn't work for.
def ps
set $str = $arg0
if (sizeof(*$str.mData) == 1 && ($str.mFlags & 1) != 0)
print $str.mData
else
pu $str.mData $str.mLength
end
end
# Define a "pa" command to display the string value for an nsIAtom
def pa
set $atom = $arg0
if (sizeof(*((&*$atom)->mString)) == 2)
pu (&*$atom)->mString
end
end
# define a "pxul" command to display the type of a XUL element from
# an nsXULDocument* pointer.
def pxul
set $p = $arg0
print $p->mNodeInfo.mRawPtr->mInner.mName->mStaticAtom->mString
end
# define a "prefcnt" command to display the refcount of an XPCOM obj
def prefcnt
set $p = $arg0
print ((nsPurpleBufferEntry*)$p->mRefCnt.mTagged)->mRefCnt
end
# define a "ptag" command to display the tag name of a content node
def ptag
set $p = $arg0
pa $p->mNodeInfo.mRawPtr->mInner.mName
end
##
## nsTArray
##
define ptarray
if $argc == 0
help ptarray
else
set $size = $arg0.mHdr->mLength
set $capacity = $arg0.mHdr->mCapacity
set $size_max = $size - 1
set $elts = $arg0.Elements()
end
if $argc == 1
set $i = 0
while $i < $size
printf "elem[%u]: ", $i
p *($elts + $i)
set $i++
end
end
if $argc == 2
set $idx = $arg1
if $idx < 0 || $idx > $size_max
printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
else
printf "elem[%u]: ", $idx
p *($elts + $idx)
end
end
if $argc == 3
set $start_idx = $arg1
set $stop_idx = $arg2
if $start_idx > $stop_idx
set $tmp_idx = $start_idx
set $start_idx = $stop_idx
set $stop_idx = $tmp_idx
end
if $start_idx < 0 || $stop_idx < 0 || $start_idx > $size_max || $stop_idx > $size_max
printf "idx1, idx2 are not in acceptable range: [0..%u].\n", $size_max
else
set $i = $start_idx
while $i <= $stop_idx
printf "elem[%u]: ", $i
p *($elts + $i)
set $i++
end
end
end
if $argc > 0
printf "nsTArray length = %u\n", $size
printf "nsTArray capacity = %u\n", $capacity
printf "Element "
whatis *$elts
end
end
document ptarray
Prints nsTArray information.
Syntax: ptarray
Note: idx, idx1 and idx2 must be in acceptable range [0...size()-1].
Examples:
ptarray a - Prints tarray content, size, capacity and T typedef
ptarray a 0 - Prints element[idx] from tarray
ptarray a 1 2 - Prints elements in range [idx1..idx2] from tarray
end
def js
call DumpJSStack()
end
def ft
call nsFrame::DumpFrameTree($arg0)
end