]> code.delx.au - gnu-emacs/blobdiff - etc/emacs-buffer.gdb
Rename a command in ru-refcard.tex.
[gnu-emacs] / etc / emacs-buffer.gdb
index b99abe8a2285795e32998b5456120f9764629c17..f0709aba7a0919336a46089091b7701d0d0e8d89 100644 (file)
@@ -1,29 +1,28 @@
 # emacs-buffer.gdb --- gdb macros for recovering buffers from emacs coredumps
 
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 # Maintainer: Noah Friedman <friedman@splode.com>
-# Status: tested with Emacs 22
+# Status: Works with Emacs 22.0.51.1 (prerelease) as of 2006-01-12.
+#         Older cvs snapshots, and released versions, will not work due to
+#         changes in lisp data structures.  But there are older versions of
+#         this gdb script which work with those versions.
 # Created: 2005-04-28
 
-# $Id$
-
 # This file is part of GNU Emacs.
-#
-# GNU Emacs is free software; you can redistribute it and/or modify
+
+# GNU Emacs is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
 # GNU Emacs is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-#
+
 # You should have received a copy of the GNU General Public License
-# along with GNU Emacs; see the file COPYING.  If not, write to the
-# Free Software Foundation, Inc.; 51 Franklin Street, Fifth Floor;
-# Boston, MA 02110-1301, USA.
+# along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 # Commentary:
 
@@ -31,8 +30,8 @@
 # an Emacs coredump; they may not always be file-backed or have a recent
 # autosave.
 #
-# The Emacs executable must have debugging symbols for this to work.  But
-# you never strip Emacs, right?  Right!
+# The Emacs executable must have debugging symbols for this to work.
+# But you never strip Emacs, right?
 #
 # The main commands of interest are `ybuffer-list', `yfile-buffers',
 # `ysave-buffer', and `ybuffer-contents'.  The `y' prefix avoids any
@@ -100,11 +99,11 @@ define ybuffer-list
   while $alist != Qnil
     ygetptr $alist
     set $this  = ((struct Lisp_Cons *) $ptr)->car
-    set $alist = ((struct Lisp_Cons *) $ptr)->cdr
+    set $alist = ((struct Lisp_Cons *) $ptr)->u.cdr
 
     # Vbuffer_alist elts are pairs of the form (name . buffer)
     ygetptr $this
-    set $buf  = ((struct Lisp_Cons *) $ptr)->cdr
+    set $buf  = ((struct Lisp_Cons *) $ptr)->u.cdr
     ygetptr $buf
     set $buf = (struct buffer *) $ptr
 
@@ -118,13 +117,13 @@ define ybuffer-list
 
       if $buf->filename != Qnil
         ygetptr $buf->filename
-        set $filename = ((struct Lisp_String *) $ptr)->data
+        printf "%2d %c  %9d %-20s %-10s %s\n", \
+               $i, $modp, ($buf->text->z_byte - 1), $name, $mode, \
+               ((struct Lisp_String *) $ptr)->data
       else
-        set $filename = ' '
+        printf "%2d %c  %9d %-20s %-10s\n", \
+               $i, $modp, ($buf->text->z_byte - 1), $name, $mode
       end
-
-      printf "%2d %c  %9d %-20s %-10s %s\n", \
-             $i, $modp, ($buf->text->z_byte - 1), $name, $mode, $filename
     end
 
     set $i++
@@ -152,7 +151,7 @@ define yset-buffer
   set $alist = Vbuffer_alist
   while ($alist != Qnil && $i > 0)
     ygetptr $alist
-    set $alist = ((struct Lisp_Cons *) $ptr)->cdr
+    set $alist = ((struct Lisp_Cons *) $ptr)->u.cdr
     set $i--
   end
 
@@ -162,7 +161,7 @@ define yset-buffer
 
   # Get the buffer object
   ygetptr $this
-  set $this = ((struct Lisp_Cons *) $ptr)->cdr
+  set $this = ((struct Lisp_Cons *) $ptr)->u.cdr
 
   ygetptr $this
   set $ycurrent_buffer = (struct buffer *) $ptr
@@ -268,3 +267,5 @@ end
 # local variables:
 # mode: gdb-script
 # end:
+
+# arch-tag: 02087f62-2663-4868-977a-1fbb2fc2e7ef