]> code.delx.au - gnu-emacs/blobdiff - src/.gdbinit
src/xdisp.c (start_hourglass) [HAVE_NTGUI]: Silence warning.
[gnu-emacs] / src / .gdbinit
index 7a6bfb07fed9ac154cfc9201eca92468b1ae84a2..fa580cc99bfd3fa2f9892beba1d5e19998de117d 100644 (file)
@@ -650,19 +650,52 @@ If the first type printed is Lisp_Vector or Lisp_Misc,
 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 & ~ARRAY_MARK_FLAG)
   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
@@ -996,7 +1029,7 @@ define xpr
   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
@@ -1121,18 +1154,18 @@ end
 define xbacktrace
   set $bt = backtrace_list
   while $bt
-    xgettype (*$bt->function)
+    xgettype ($bt->function)
     if $type == Lisp_Symbol
-      xprintsym (*$bt->function)
+      xprintsym ($bt->function)
       printf " (0x%x)\n", $bt->args
     else
-      xgetptr *$bt->function
+      xgetptr $bt->function
       printf "0x%x ", $ptr
       if $type == Lisp_Vectorlike
-       xgetptr (*$bt->function)
+       xgetptr ($bt->function)
         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
        end