-# Copyright (C) 1992-1998, 2000-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2014 Free Software Foundation, Inc.
#
# This file is part of GNU Emacs.
#
else
set $bugfix = $arg0
end
- set $ptr = ($bugfix & VALMASK) | DATA_SEG_BITS
+ set $ptr = $bugfix & VALMASK
end
define xgetint
else
set $bugfix = $arg0
end
- set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : $bugfix >> VALBITS)
+ set $type = (enum Lisp_Type) (USE_LSB_TAG ? $bugfix & (1 << GCTYPEBITS) - 1 : (EMACS_UINT) $bugfix >> VALBITS)
end
# Set up something to print out s-expressions.
define pwinx
set $w = $arg0
- xgetint $w->sequence_number
if ($w->mini_p != Qnil)
printf "Mini "
end
end
define prowlims
- printf "edges=(%d,%d),r2l=%d,cont=%d,trunc=(%d,%d),at_zv=%d\n", $arg0->minpos.charpos, $arg0->maxpos.charpos, $arg0->reversed_p, $arg0->continued_p, $arg0->truncated_on_left_p, $arg0->truncated_on_right_p, $arg0->ends_at_zv_p
+ printf "edges=(%d,%d),enb=%d,r2l=%d,cont=%d,trunc=(%d,%d),at_zv=%d\n", $arg0->minpos.charpos, $arg0->maxpos.charpos, $arg0->enabled_p, $arg0->reversed_p, $arg0->continued_p, $arg0->truncated_on_left_p, $arg0->truncated_on_right_p, $arg0->ends_at_zv_p
end
document prowlims
Print important attributes of a glyph_row structure.
a second line gives the more precise type.
end
+define pvectype
+ set $size = ((struct Lisp_Vector *) $arg0)->header.size
+ if ($size & PSEUDOVECTOR_FLAG)
+ output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
+ else
+ output PVEC_NORMAL_VECTOR
+ end
+ echo \n
+end
+document pvectype
+Print the subtype of vectorlike object.
+Takes one argument, a pointer to an object.
+end
+
define xvectype
xgetptr $
- set $size = ((struct Lisp_Vector *) $ptr)->header.size
+ pvectype $ptr
+end
+document xvectype
+Print the subtype of vectorlike object.
+This command assumes that $ is a Lisp_Object.
+end
+
+define pvecsize
+ set $size = ((struct Lisp_Vector *) $arg0)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ output ($size & PSEUDOVECTOR_SIZE_MASK)
+ echo \n
+ output (($size & PSEUDOVECTOR_REST_MASK) >> PSEUDOVECTOR_SIZE_BITS)
else
- output $size & ~ARRAY_MARK_FLAG
+ output $size
end
echo \n
end
-document xvectype
-Print the size or vector subtype of $.
-This command assumes that $ is a vector or pseudovector.
+document pvecsize
+Print the size of vectorlike object.
+Takes one argument, a pointer to an object.
+end
+
+define xvecsize
+ xgetptr $
+ pvecsize $ptr
+end
+document xvecsize
+Print the size of $
+This command assumes that $ is a Lisp_Object.
end
define xmisctype
define xvector
xgetptr $
print (struct Lisp_Vector *) $ptr
- output ($->header.size > 50) ? 0 : ($->contents[0])@($->header.size & ~ARRAY_MARK_FLAG)
+ output ($->header.size > 50) ? 0 : ($->contents[0])@($->header.size)
echo \n
end
document xvector
if $type == Lisp_Vectorlike
set $size = ((struct Lisp_Vector *) $ptr)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ set $vec = (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
if $vec == PVEC_NORMAL_VECTOR
xvector
end
define xprintstr
set $data = (char *) $arg0->data
- output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~ARRAY_MARK_FLAG : $arg0->size_byte)
+ set $strsize = ($arg0->size_byte < 0) ? $arg0->size : $arg0->size_byte
+ # GDB doesn't like zero repetition counts
+ if $strsize == 0
+ output ""
+ else
+ output ($arg0->size > 1000) ? 0 : ($data[0])@($strsize)
+ end
end
define xprintsym
end
define xcoding
- set $tmp = (struct Lisp_Hash_Table *) ((Vcoding_system_hash_table & VALMASK) | DATA_SEG_BITS)
- set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & VALMASK) | DATA_SEG_BITS)
+ set $tmp = (struct Lisp_Hash_Table *) (Vcoding_system_hash_table & VALMASK)
+ set $tmp = (struct Lisp_Vector *) ($tmp->key_and_value & VALMASK)
set $name = $tmp->contents[$arg0 * 2]
print $name
pr
end
define xcharset
- set $tmp = (struct Lisp_Hash_Table *) ((Vcharset_hash_table & VALMASK) | DATA_SEG_BITS)
- set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & VALMASK) | DATA_SEG_BITS)
+ set $tmp = (struct Lisp_Hash_Table *) (Vcharset_hash_table & VALMASK)
+ set $tmp = (struct Lisp_Vector *) ($tmp->key_and_value & VALMASK)
p $tmp->contents[charset_table[$arg0].hash_index * 2]
pr
end
end
define xbacktrace
- set $bt = backtrace_list
- while $bt
- xgettype ($bt->function)
+ set $bt = backtrace_top ()
+ while backtrace_p ($bt)
+ set $fun = backtrace_function ($bt)
+ xgettype $fun
if $type == Lisp_Symbol
- xprintsym ($bt->function)
- printf " (0x%x)\n", $bt->args
+ xprintsym $fun
+ printf " (0x%x)\n", backtrace_args ($bt)
else
- xgetptr $bt->function
+ xgetptr $fun
printf "0x%x ", $ptr
if $type == Lisp_Vectorlike
- xgetptr ($bt->function)
+ xgetptr $fun
set $size = ((struct Lisp_Vector *) $ptr)->header.size
if ($size & PSEUDOVECTOR_FLAG)
- output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_SIZE_BITS)
+ output (enum pvec_type) (($size & PVEC_TYPE_MASK) >> PSEUDOVECTOR_AREA_BITS)
else
- output $size & ~ARRAY_MARK_FLAG
+ output $size
end
else
printf "Lisp type %d", $type
end
echo \n
end
- set $bt = $bt->next
+ set $bt = backtrace_next ($bt)
end
end
document xbacktrace
define xprintbytestr
set $data = (char *) $arg0->data
+ set $bstrsize = ($arg0->size_byte < 0) ? $arg0->size : $arg0->size_byte
printf "Bytecode: "
- output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~ARRAY_MARK_FLAG : $arg0->size_byte)
+ if $bstrsize > 0
+ output/u ($arg0->size > 1000) ? 0 : ($data[0])@($bvsize)
+ else
+ printf ""
+ end
end
document xprintbytestr
Print a string of byte code.
# Show Lisp backtrace after normal backtrace.
define hookpost-backtrace
- set $bt = backtrace_list
- if $bt
+ set $bt = backtrace_top ()
+ if backtrace_p ($bt)
echo \n
echo Lisp Backtrace:\n
xbacktrace