summaryrefslogtreecommitdiff
path: root/src/.gdbinit
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2012-11-09 15:38:31 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2012-11-09 15:38:31 +0400
commit7d377c482f6e60464c9891ee64cf6bcdf770a707 (patch)
treecbc3bd3c5569c9e5a5857f0ef151e98b94e9a36a /src/.gdbinit
parent7ad27466f1bd9a61389b8b8b83db21ff2acfc575 (diff)
downloademacs-7d377c482f6e60464c9891ee64cf6bcdf770a707.tar.gz
Tweak last vectorlike_header change.
* alloc.c (struct Lisp_Vectorlike_Free): Special type to represent vectorlike object on the free list. This is introduced to avoid some (but not all) pointer casting and aliasing problems, see http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html. * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike objects. (xvectype, xvecsize): Use them to examine Lisp_Object values.
Diffstat (limited to 'src/.gdbinit')
-rw-r--r--src/.gdbinit36
1 files changed, 26 insertions, 10 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index f187bafcba7..fa580cc99bf 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -650,9 +650,8 @@ If the first type printed is Lisp_Vector or Lisp_Misc,
a second line gives the more precise type.
end
-define xvectype
- xgetptr $
- set $size = ((struct Lisp_Vector *) $ptr)->header.size
+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
@@ -660,14 +659,22 @@ define xvectype
end
echo \n
end
-document xvectype
-Print the type or vector subtype of $.
-This command assumes that $ is a vector or pseudovector.
+document pvectype
+Print the subtype of vectorlike object.
+Takes one argument, a pointer to an object.
end
-define xvecsize
+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 ($size & PSEUDOVECTOR_SIZE_MASK)
echo \n
@@ -677,9 +684,18 @@ define xvecsize
end
echo \n
end
+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 or vector subtype of $.
-This command assumes that $ is a vector or pseudovector.
+Print the size of $
+This command assumes that $ is a Lisp_Object.
end
define xmisctype