2020-06-16 18:45:43 +03:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2020-06-15 06:44:42 +03:00
|
|
|
# .gdbinit file for debugging Mozilla
|
2012-05-04 04:06:14 +04:00
|
|
|
|
2020-06-15 06:44:42 +03:00
|
|
|
# You may need to put an 'add-auto-load-safe-path' command in your
|
|
|
|
# $HOME/.gdbinit file to get GDB to trust this file. If your builds are
|
|
|
|
# generally in $HOME/moz, then you can say:
|
|
|
|
#
|
|
|
|
# add-auto-load-safe-path ~/moz
|
2012-12-02 09:25:16 +04:00
|
|
|
|
2012-05-04 04:06:14 +04:00
|
|
|
# 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
|
|
|
|
|
2016-10-14 21:27:44 +03:00
|
|
|
# Don't stop for certain other signals where it's not useful,
|
|
|
|
# such as the SIG64 signals triggered by the Linux
|
|
|
|
# sandboxing code on older kernels.
|
|
|
|
handle SIG38 noprint nostop pass
|
|
|
|
handle SIG64 noprint nostop pass
|
2016-11-16 09:13:22 +03:00
|
|
|
handle SIGSYS noprint nostop pass
|
2016-10-14 21:27:44 +03:00
|
|
|
|
2012-05-04 04:06:14 +04:00
|
|
|
# Show the concrete types behind nsIFoo
|
|
|
|
set print object on
|
|
|
|
|
|
|
|
# run when using the auto-solib-add trick
|
2020-03-31 01:07:11 +03:00
|
|
|
define prun
|
2012-05-04 04:06:14 +04:00
|
|
|
tbreak main
|
|
|
|
run
|
|
|
|
set auto-solib-add 0
|
|
|
|
cont
|
|
|
|
end
|
|
|
|
|
|
|
|
# run -mail, when using the auto-solib-add trick
|
2020-03-31 01:07:11 +03:00
|
|
|
define pmail
|
2012-05-04 04:06:14 +04:00
|
|
|
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.
|
2020-03-31 01:07:11 +03:00
|
|
|
define pu
|
2012-05-04 04:06:14 +04:00
|
|
|
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.
|
2020-03-31 01:07:11 +03:00
|
|
|
define ps
|
2012-05-04 04:06:14 +04:00
|
|
|
set $str = $arg0
|
|
|
|
if (sizeof(*$str.mData) == 1 && ($str.mFlags & 1) != 0)
|
|
|
|
print $str.mData
|
|
|
|
else
|
|
|
|
pu $str.mData $str.mLength
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
# Define a "pa" command to display the string value for an nsAtom
|
2020-03-31 01:07:11 +03:00
|
|
|
define pa
|
2012-05-04 04:06:14 +04:00
|
|
|
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
|
2013-03-26 19:31:53 +04:00
|
|
|
# an nsXULElement* pointer.
|
2020-03-31 01:07:11 +03:00
|
|
|
define pxul
|
2012-05-04 04:06:14 +04:00
|
|
|
set $p = $arg0
|
|
|
|
print $p->mNodeInfo.mRawPtr->mInner.mName->mStaticAtom->mString
|
|
|
|
end
|
|
|
|
|
|
|
|
# define a "prefcnt" command to display the refcount of an XPCOM obj
|
2020-03-31 01:07:11 +03:00
|
|
|
define prefcnt
|
2012-05-04 04:06:14 +04:00
|
|
|
set $p = $arg0
|
|
|
|
print ((nsPurpleBufferEntry*)$p->mRefCnt.mTagged)->mRefCnt
|
|
|
|
end
|
|
|
|
|
|
|
|
# define a "ptag" command to display the tag name of a content node
|
2020-03-31 01:07:11 +03:00
|
|
|
define ptag
|
2012-05-04 04:06:14 +04:00
|
|
|
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.
|
2020-06-16 18:45:43 +03:00
|
|
|
Syntax: ptarray
|
2012-05-04 04:06:14 +04:00
|
|
|
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
|
|
|
|
|
2020-03-31 01:07:11 +03:00
|
|
|
define js
|
2012-05-04 04:06:14 +04:00
|
|
|
call DumpJSStack()
|
|
|
|
end
|
|
|
|
|
2021-09-10 19:39:15 +03:00
|
|
|
define ct
|
|
|
|
call $arg0->Dump()
|
|
|
|
end
|
|
|
|
|
2020-03-31 01:07:11 +03:00
|
|
|
define ft
|
2014-09-03 01:33:44 +04:00
|
|
|
call $arg0->DumpFrameTree()
|
2012-05-04 04:06:14 +04:00
|
|
|
end
|
2014-03-19 21:53:16 +04:00
|
|
|
|
2020-04-08 02:42:38 +03:00
|
|
|
define ftp
|
|
|
|
call $arg0->DumpFrameTreeInCSSPixels()
|
|
|
|
end
|
|
|
|
|
2020-03-31 01:07:11 +03:00
|
|
|
define ftl
|
2018-08-28 23:20:21 +03:00
|
|
|
call $arg0->DumpFrameTreeLimited()
|
|
|
|
end
|
|
|
|
|
2020-04-08 02:42:38 +03:00
|
|
|
define ftlp
|
|
|
|
call $arg0->DumpFrameTreeLimitedInCSSPixels()
|
|
|
|
end
|