X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/14beddf4711854b01d400f36166dc71eb39435bb..refs/heads/wip:/etc/emacs-buffer.gdb diff --git a/etc/emacs-buffer.gdb b/etc/emacs-buffer.gdb index 14a7615801..ee786cff76 100644 --- a/etc/emacs-buffer.gdb +++ b/etc/emacs-buffer.gdb @@ -1,12 +1,8 @@ # emacs-buffer.gdb --- gdb macros for recovering buffers from emacs coredumps -# Copyright (C) 2005-2011 Free Software Foundation, Inc. +# Copyright (C) 2005-2014 Free Software Foundation, Inc. # Maintainer: Noah Friedman -# 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 # This file is part of GNU Emacs. @@ -37,6 +33,10 @@ # `ysave-buffer', and `ybuffer-contents'. The `y' prefix avoids any # namespace collisions with emacs/src/.gdbinit. +# Since the internal data structures in Emacs occasionally from time to +# time, you should use the version of this file that came with your +# particular Emacs version; older versions might not work anymore. + # Example usage: # # $ gdb /export/src/emacs/2005-05-02--03-17/src/emacs core.emacs.6.9845 @@ -70,19 +70,16 @@ # Code: -# Force loading of symbols, enough to give us gdb_valbits etc. +# Force loading of symbols, enough to give us VALMASK etc. set main # When nonzero, display some extra diagnostics in various commands set $yverbose = 1 set $yfile_buffers_only = 0 -set $tagmask = (((long)1 << gdb_gctypebits) - 1) -set $valmask = gdb_use_lsb ? ~($tagmask) : ((long)1 << gdb_valbits) - 1 - define ygetptr set $ptr = $arg0 - set $ptr = (gdb_use_union ? $ptr.u.val : $ptr & $valmask) | gdb_data_seg_bits + set $ptr = (CHECK_LISP_OBJECT_TYPE ? $ptr.i : $ptr) & VALMASK end define ybuffer-list @@ -107,16 +104,16 @@ define ybuffer-list ygetptr $buf set $buf = (struct buffer *) $ptr - if ! ($files_only && $buf->filename == Qnil) - ygetptr $buf->name + if ! ($files_only && $buf->filename_ == Qnil) + ygetptr $buf->name_ set $name = ((struct Lisp_String *) $ptr)->data set $modp = ($buf->text->modiff > $buf->text->save_modiff) ? '*' : ' ' - ygetptr $buf->mode_name + ygetptr $buf->mode_name_ set $mode = ((struct Lisp_String *) $ptr)->data - if $buf->filename != Qnil - ygetptr $buf->filename + if $buf->filename_ != Qnil + ygetptr $buf->filename_ printf "%2d %c %9d %-20s %-10s %s\n", \ $i, $modp, ($buf->text->z_byte - 1), $name, $mode, \ ((struct Lisp_String *) $ptr)->data @@ -193,7 +190,7 @@ document yget-buffer-pointers end define yget-current-buffer-name - set $this = $ycurrent_buffer->name + set $this = $ycurrent_buffer->name_ ygetptr $this set $ycurrent_buffer_name = ((struct Lisp_String *) $ptr)->data end @@ -267,4 +264,3 @@ end # local variables: # mode: gdb-script # end: -